Variable-Size Window
Grow the right end until a condition holds, then shrink the left end while it still does.
Sliding Window: Shortest run summing to 7
Grow right to index 0. 2 joins, so the sum is 2. Still short of 7.
Cost
- Best
- O(n)
- Average
- O(n)
- Worst
- O(n)
- Space
- O(k)
Before this
Leads to
Topics that need this one first.
Taught by the same lesson
Sliding Window covers these too, in the same run.