In a given array nums of positive integers, find three non-overlapping subarrays with maximum sum.
Each subarray would be k is of size, and we want to maximize the sum of all 3*k entries.
Return The result as a list of indices representing the starting position of each interval (0-indexed). If There is multiple answers, return the lexicographically smallest one.
Example:
Input: [1,2,1,2,6,7,5,1], 2Output: [0, 3, 5]explanation:subarrays [1, 2], [2, 6], [7, 5] correspond to the starting Indic Es [0, 3, 5]. We could has also taken [2, 1], but a answer of [1, 3, 5] would be lexicographically larger.
Note:
nums.lengthwould be between 1 and 20000.
nums[i]would be between 1 and 65535.
k'll is between 1 and floor (NUMS.LENGTH/3).
S
[Leetcode] Maximum Sum of 3 non-overlapping subarrays three phenanthrene overlapping sub-arrays of the most Yamato