Medium · Dynamic programming

Maximum Subarray

Find the run of consecutive numbers with the largest sum, and return that sum.

nums = [-2, 1, -3, 4, -1, 2, 1, -5, 4]

→ 6   ([4, -1, 2, 1])
Record your take

No one has solved it yet.