I Implemented the Kadane's Max Sub array problem in javascript but seems i end up always getting 0 in the console even though there exists higher numbers( I understand that it does what it's doing because of for loop from 0 - size
where size = subarray size
).
So how do i implement the algorithm correctly?
Does it also work for all positive integer array?