I remember how I stuck with this problem for a long time, was trying solve the problem with two pointers, but in fact, it's a combination of prefixSum + Kadane's algorithm. From what I learnt, you can't use 2 pointers technique if you have negative numbers in input array, does it sound right?
You da best man
Great video thank you!!
Thank you so much
I remember how I stuck with this problem for a long time, was trying solve the problem with two pointers, but in fact, it's a combination of prefixSum + Kadane's algorithm. From what I learnt, you can't use 2 pointers technique if you have negative numbers in input array, does it sound right?
Neat solution
An more problems that use Kandane Algorithm