Link to the question: https://cses.fi/problemset/task/1643.
I’m a little confused on how to solve it. Here is what I’m thinking right now. First I’ll create a prefix array given the input array. Now I’m confused on how to find the max subarray sum, won’t I have to try every combination of sum to find the maximum one? Or is there a more efficient way of finding the maximum subarray sum?
Please let me know!