Given an integer array nums, find the contiguous subarray (containing at least one number) with the largest sum, and return that sum.
Example
nums = [-2, 1, -3, 4, -1, 2, 1, -5, 4]
=> 6 // subarray [4, -1, 2, 1]
function MaxSubArray(nums: int[]) -> int
Found a bug? Or annoyed about something in the language? Tell us.