#3430

Maximum and Minimum Sums of at Most Size K Subarrays

international master · 2100 · lc hard +32 · 25.2% accepted · 80 likes · top 4%

Description

You are given an integer array nums and a positive integer k. Return the sum of the maximum and minimum elements of every subarray with at most k elements.

Code

1
2
3