Examples : Input : a[] = {1, -2, 1, 1, -2, 1} Output : Length of the subarray is 2 Explanation: Subarray with consecutive elements and maximum sum will be {1, 1}. So length is 2
Input : ar[] = { -2, -3, 4, -1, -2, 1, 5, -3 } Output : Length of the subarray is 5 Explanation: Subarray with consecutive elements and maximum sum will be {4, -1, -2, 1, 5}.