Sliding Window

The sliding window technique is a method used to efficiently process subarrays, substrings, or segments of a larger indexable data structure by maintaining a window (subset) that moves through the data by some step size, avoiding repeated computations.

The step size of the window can be fixed or variable, depending on the problem.