Sliding Window
Solve fixed-window problems: maximum sum of k elements, moving averages, and O(n) updates as the window slides.
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.
Find the index of a target value in a sorted array.
Find the index where a target value is, or where it should be inserted, in a sorted array.
Find the first bad version in a sequence using as few checks as possible.
Compute the integer square root of a number without using built-in power functions.
Find a target value in a sorted array that has been rotated at an unknown point.
Find the first and last index of a target value in a sorted array.
Find any element in an array that is bigger than both of its neighbors.
Find a target value inside a matrix where each row and column is sorted.
Find the slowest eating speed that still finishes every pile of bananas in time.
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).
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.
Try a choice, keep going, and undo it if it fails, used to generate permutations, combinations, and valid layouts.