Skip to content

Latest commit

 

History

History

Maximum Subarray Sum

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

You are given a one dimensional array that may contain both positive and negative integers, find the sum of contiguous subarray of numbers which has the largest sum.

For example, if the given array is {-2, -5, 6, -2, -3, 1, 5, -6}, then the maximum subarray sum is 7 (see highlighted elements).