LeetCode: Max Subarray

Approach 1: Dynamical programming: We should ignore the sum of the
previous n-1 elements if nth element is greater than the sum.