Practice Sum of K Subarrays With Length at Least M
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Medium#3473
LeetCode ProblemSum of K Subarrays With Length at Least M
Problem Statement
You are given an integer array nums and two integers, k and m. Return the maximum sum of k non-overlapping subarrays of nums, where each subarray has a length of at least m.
Source: Sum of K Subarrays With Length at Least M on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
nums = [1,2,-1,3,3,4], k = 2, m = 2
Output
13
# Example 2
Input
nums = [-10,3,-1,-2], k = 4, m = 1
Output
-10
Constraints
1 <= nums.length <= 2000
-10^4 <= nums[i] <= 10^4
1 <= k <= floor(nums.length / m)
1 <= m <= 3
Related LeetCode Problems
Practice more problems similar to Sum of K Subarrays With Length at Least M.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.