Sliding Window
Solve fixed-window problems: maximum sum of k elements, moving averages, and O(n) updates as the window slides.
Make the locally best choice at each step and never look back, useful when local optima add up to a global optimum.
Check whether you can reach the last position of an array given each element's max jump length.
Find the minimum number of jumps needed to reach the last position of an array.
Find the starting gas station that lets you complete a full circuit without running out of fuel.
Find the minimum time needed to finish a list of tasks with a required cooldown between repeats.
Split a string into the most parts possible so each letter appears in only one part.
Find the fewest intervals to remove so none of the remaining intervals overlap.
Maximize profit from a stock by buying and selling as many times as you like.
Find the fewest arrows needed to burst every balloon interval on a line.
Solve fixed-window problems: maximum sum of k elements, moving averages, and O(n) updates as the window slides.
Scan a sorted array or string from both ends at once to find pairs, remove duplicates, or reverse data in O(n).
Cut a sorted range in half on every step to find a value or boundary in O(log n) instead of checking one by one.
Explore as far as possible down one path before backtracking, used to walk trees, graphs, and grids.
Explore level by level from a starting point, the go-to way to find the shortest path in an unweighted graph.
Break a problem into overlapping subproblems and reuse their answers to avoid recomputing the same work.