Kadane's algorithm Used to find the sum of contiguous subarray within a one-dimensional array of numbers which has the largest sum.