Sponsored
Use these hints if you're stuck. Try solving on your own first.
We can use prefix sums to calculate any subarray sum quickly. For each L length subarray, find the best possible M length subarray that occurs before and after it.
Solve with full IDE support and test cases