You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Idea of the Kadane’s algorithm is to look for all positive contiguous segments of the array And keep track of maximum sum contiguous(max_so_far) segment among all positive segments. Each time we get a positive sum compare it with maximum till now and update it if it is greater than maximum and if the current_sum is less than 0 make it 0.