ASKED IN
Google
LARGEST SUM
CONTIGUOUS SUBARRAY
Given an array arr[] of size N. The task
is to find the sum of the contiguous
subarray within a arr[] with the largest
sum.
Input :
arr[] = { -2, -3, 4, -1, -2, 1, 5, -3 }
Output : 7
Explanation:
Subarray: { 4, -1, -2, 1, 5 } will give max
sum.
If not able to solve then
SEARCH Coding Mafia on Google.