Daily challenge for 2026-01-06
371. Maximum Sum of Non-Overlapping Subarrays
Given an array of positive integers nums and an integer k, find the maximum sum you can obtain by selecting two non-overlapping subarrays, each of length exactly k. The two subarrays must not share any elements.
Example:Input: nums = [1, 2, 1, 2, 6, 7, 5, 1], k = 2Output: 20 (Subarrays [2, 6] sum=8 and [7, 5] sum=12. Total = 20)
Run this challenge interactively in Python or JavaScript when the app loads.