Tap here to switch tabs
Problem
Submissions

Problem: Maximum Sum of Two Non-Overlapping Subarrays

Try to solve the Maximum Sum of Two Non-Overlapping Subarrays problem.

Statement

Given an integer array nums and two integers firstLen and secondLen, return the maximum sum of elements in 22 non overlapping subarrays of lengths firstLen and secondLen.

The subarrays must be contiguous segments of the array that do not intersect. The subarray of length firstLen may occur before or after the subarray of length secondLen.

Constraints:

  • 1≤1 \leq firstLen, secondLen ≤1000\leq 1000

  • 2≤2 \leq firstLen ++ secondLen ≤1000\leq 1000

  • firstLen ++ secondLen ≤\leq nums.length ≤1000\leq 1000

  • 0≤0 \leq nums[i] ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Sum of Two Non-Overlapping Subarrays

Try to solve the Maximum Sum of Two Non-Overlapping Subarrays problem.

Statement

Given an integer array nums and two integers firstLen and secondLen, return the maximum sum of elements in 22 non overlapping subarrays of lengths firstLen and secondLen.

The subarrays must be contiguous segments of the array that do not intersect. The subarray of length firstLen may occur before or after the subarray of length secondLen.

Constraints:

  • 1≤1 \leq firstLen, secondLen ≤1000\leq 1000

  • 2≤2 \leq firstLen ++ secondLen ≤1000\leq 1000

  • firstLen ++ secondLen ≤\leq nums.length ≤1000\leq 1000

  • 0≤0 \leq nums[i] ≤1000\leq 1000