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
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
Thanks