3364. Minimum Positive Sum Subarray
You are given an integer array
nums
and two integersl
andr
. Your task is to find the minimum sum of a subarray whose size is betweenl
andr
(inclusive) and whose sum is greater than 0.Return the minimum sum of such a subarray. If no such subarray exists, return -1.
A subarray is a contiguous non-empty sequence of elements within an array.
c++
1 | class Solution { |