max_subarray.go
Go 1.26
Not run yet
+ 7 hidden
Input
nums = [4, -6, 3, 5, -2, 6, -9, 1]
Expected
12
The run [3, 5, -2, 6] sums to 12. The -2 is worth carrying because the 6 after it more than pays it back.
+ 7 hidden
nums = [4, -6, 3, 5, -2, 6, -9, 1]
12
The run [3, 5, -2, 6] sums to 12. The -2 is worth carrying because the 6 after it more than pays it back.