- Constant window size (not asked many times)
- arr = [-1, 3, 4, 5, -1] & k = 4
- Max sum that you can get by picking up k=4 consecutive elements.
- Here we'll keep the window size constant and move the window till
right < arr.length.
sum = 7, l = 0, r = k - 1
while(r < arr.length - 1){
sum = sum - arr[l];
l++;
r++;
sum += arr[r];
maxSum = max(maxSum, sum);
}- Longest subarray/substring where <condition>
- This is basically acquire and release strategy Acquire and Release Strategy or Expand and Shrink strategy.
- Let's consider this question and see the different strategies to solve it.


