Categories

Arrays & Hashing10

Trade time for space: hash maps and sets turn repeated "have I seen this?" scans into O(1) lookups, and prefix sums turn range questions into subtraction.

crash course ↗
Two Pointers9

Two indices walking a sorted or symmetric array — converging from the ends or chasing each other — collapse an O(n²) pair search into a single O(n) sweep with O(1) space.

crash course ↗
Sliding Window8

A grow-right / shrink-left window over a contiguous subarray or substring answers "best/longest/shortest run satisfying a condition" in one O(n) pass.

crash course ↗
Stack9

LIFO bookkeeping: match pairs, defer work until you can resolve it, and use the monotonic-stack trick to find the next greater/smaller element in O(n).

crash course ↗
Binary Search10

Halve a sorted — or monotonically decidable — search space each step. The hard part is rarely the array; it is spotting the monotone predicate to bisect.

crash course ↗
Strings8

Strings are arrays of characters with their own toolkit: frequency counts, two pointers, sliding windows, and careful index arithmetic.

crash course ↗
Bit Manipulation7

Treat integers as bit vectors: XOR cancels pairs, AND masks, shifts move, and n & (n-1) clears the lowest set bit — O(1)-ish tricks that replace whole loops.

crash course ↗
Dynamic Programming24

Define a state, write a recurrence over smaller subproblems, then memoize or tabulate. Most DP is recognizing the state, not the code.

crash course ↗
Backtracking11

Build a candidate incrementally, recurse, then undo the last choice. The template is fixed; the art is the choices, the prune, and the base case.

crash course ↗
Greedy6

Make the locally optimal choice and never reconsider. Fast and short — but only correct when an exchange argument proves the greedy choice is safe.

crash course ↗
Graphs20

Model the problem as nodes and edges, then pick the traversal: BFS for shortest unweighted paths and levels, DFS for connectivity and cycles, union-find for grouping, topo sort for ordering.

crash course ↗
Intervals6

Almost every interval problem starts by sorting on start (or end), then making a single sweep that merges, counts overlaps, or greedily keeps the earliest finisher.

crash course ↗
Linked List11

Pointer surgery without random access: dummy heads tame edge cases, fast/slow pointers find middles and cycles, and reversal is the recurring sub-move.

crash course ↗
Matrix5

A grid is a graph in disguise. Master index↔coordinate math, in-place transforms (transpose + reverse), and 4-directional BFS/DFS flood fills.

crash course ↗
Math & Geometry7

Pattern-spot the closed form: digit manipulation, modular cycles, fast exponentiation, and coordinate tricks that sidestep brute force.

crash course ↗
Trees18

Recursion is the native language of trees: answer the question for the children, then combine. DFS for structure, BFS for levels, in-order for BST sortedness.

crash course ↗
Tries5

A prefix tree turns a set of words into a character-by-character path graph, making prefix queries, autocomplete, and word-search backtracking efficient.

crash course ↗
Heap / Priority Queue11

When you repeatedly need the current min or max, a heap gives O(log n) push/pop. Top-K, merging k streams, and running medians all lean on it.

crash course ↗

Techniques

Approach Quiz
0 / 185 attempted
Arrays & Hashing
Two Pointers
Sliding Window
Stack
Binary Search
Strings
Binary
Dynamic Programming
Backtracking
Greedy
Graphs
Intervals
Linked List
Matrix
Math & Geometry
Trees
Tries
Heap / Priority Queue