689 Maximum Sum of 3 Non-Overlapping Subarrays
1. Question
Input: [1,2,1,2,6,7,5,1], 2
Output: [0, 3, 5]
Explanation:
Subarrays [1, 2], [2, 6], [7, 5] correspond to the starting indices [0, 3, 5].
We could have also taken [2, 1], but an answer of [1, 3, 5] would be lexicographically larger.2. Implementation
3. Time & Space Complexity
Last updated