omg I solved it exactly the way you did!! PROGRESS AT LAST
I just used the target variable with no sum value. So when you add to the array you subtract from the target and when you remove from the array you add to the target. Then just compare the target to zero to see if your subarray is satisfactory.
what if each number in the beginning of the array is greater than the target?
Instead of moving r at 3:00 you could have moved both l and r since we need a minimum window than 5
can't we write a base case like sum(nums) < target: return 0 ?
Solved the same question like 3 hours ago lol
@GregHogg