Given an integer array nums, find the contiguous subarray (containing at least one number) with the largest sum, and return that sum.
Input: one line of space-separated integers. Output: the maximum subarray sum.
-2 1 -3 4 -1 2 1 -5 4
6
[4,-1,2,1] has sum 6.
5 4 -1 7 8
23
The whole array sums to 23.
Run your code against the sample tests, or Submit to run the full suite.