Implement a function that finds the maximum sum of a subarray in a given array.
MediumProblem Statement
Implement a function that finds the maximum sum of a subarray in a given array.
Sample Input
[1, -2, 3, 4, -1, 2, 1, -5, 4]
Sample Output
9
Limits
Time: 2s · Memory: 256 MB