Sliding Window

Keep a running window over a sequence, growing and shrinking it instead of recomputing from scratch.

  1. 01

    Best Day to Buy and Sell

    • easy
    • Pro
  2. 02

    Highest Average Block

    • easy
    • Pro
  3. 03

    Longest Run Without Repeats

    • medium
    • Pro
  4. 04

    Longest Repeat After Replacements

    • medium
    • Pro
  5. 05

    Find an Anagram Inside

    • medium
    • Pro
  6. 06

    Shortest Stretch Reaching a Sum

    • medium
    • Pro
  7. 07

    Smallest Window Containing All

    • hard
    • Pro
  8. 08

    Maximum in Each Window

    • hard
    • Pro