I have understand the concept of Kadane’s algorithm. Here , we take the currentSum as max(currentSum+arr[i],currentSum). and then maximumSum as max(currentSum,maximumSum)
But I cannot understand why this algorithm works ? . Please help me understand it
Thank You.