SPLIT ARRAY LARGEST SUM | LEETCODE # 410 | PYTHON BINARY SEARCH

Поділитися
Вставка

КОМЕНТАРІ • 2

  • @michaelhernandez5478
    @michaelhernandez5478 2 роки тому

    Thanks for doing this one. I was a little confused behind the reasoning for picking the left boundary as the max integer. The problem states the integers are all non-negative, but the worst case example you use at 4:10 talks about the possibility of negative values. Something I thought was a little more intuitive was that because all values are positive, and because the array can be split as small as n subarray sums, or as large as 1 subarray sum, there's no escaping the largest value as part of the range of possibilities-- but no lower-- because negative values can't exist to surround and bring down that largest value in a contiguous subarray.
    Just a heads up, the binary search template from the other problems works fine here too; instead of wondering whether to use l

  • @subee128
    @subee128 9 місяців тому

    Thanks