Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 301 Bytes

File metadata and controls

3 lines (2 loc) · 301 Bytes

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).