You'll forget most of these problems.Algorythms brings each one back before you do.

151 LeetCode problems, grouped by the pattern that solves each one.

START PRACTISING +HOVER THE WALL TO SEE EACH PROBLEM’S PATTERN

PATTERN ·

#3 · MEDIUMSOLVED 7 DAYS AGO

Longest Substring Without Repeating Characters

Keep the last index of every character. When one repeats, move the left edge past it.
SLIDING WINDOW
THIS CARD IS FADING. HOW WELL DID YOU REMEMBER IT?

HOW REVIEWS WORK

Rate a problem, and it comes back just before you’d forget it.

Reviews are scheduled with SM-2, the same algorithm Anki uses. Forget a problem and it’s back tomorrow. Remember it and the gap grows: 1 day, then 6, 15, 38. On this page a day passes in about two seconds, so try rating this card a few times.

WHY PATTERNS

MARCHYou solve 3Sum.

JUNEThe interviewer asks Container With Most Water. It looks like a problem you've never seen.

WHYBoth are solved with two pointers moving toward each other. What you kept from March was the 3Sum code, and that code doesn't help with a different problem.

Learn the pattern, and new problems start to look familiar.

Each pattern page explains the idea and lists the phrases that point to it. Its problems go from easy to hard, and hints open one at a time.

Solved problems come back for review. Analytics shows which patterns you keep forgetting and which ones you mix up.

No account. Your progress and notes stay in your browser.

ALL PATTERNSWHAT GIVES IT AWAYPROBLEMS
01

Arrays & Hashing

"FIND A PAIR WITH..."10
02

Sliding Window

"CONTIGUOUS", "LONGEST SUBSTRING"07
03

Two Pointers

SORTED ARRAY, PAIR OR TRIPLET SUM08
04

Fast & Slow Pointers

CYCLE, O(1) MEMORY04
05

Merge Intervals

OVERLAPPING INTERVALS05
06

Cyclic Sort

NUMBERS IN RANGE [1, N]03
07

In-place List Reversal

REVERSE A LINKED LIST04
08

Tree BFS

LEVEL BY LEVEL05
09

Tree DFS

ROOT-TO-LEAF PATHS11
10

Two Heaps

MEDIAN OF A STREAM03
11

Subsets / Combinations

ALL SUBSETS05
12

Modified Binary Search

SORTED OR ROTATED09
13

Monotonic Stack

NEXT GREATER ELEMENT07
14

Backtracking

ALL VALID COMBINATIONS06
15

Trie

PREFIX SEARCH05
16

Topological Sort

PREREQUISITES04
17

Graph BFS / DFS

ISLANDS, COMPONENTS13
18

Dynamic Programming

COUNT WAYS, MIN / MAX24
19

Bitwise XOR

APPEARS ONCE02
20

Heap / Priority Queue

"TOP K"10
21

Stack

MATCHING BRACKETS03
22

Game Theory & Minimax

TWO PLAYERS, OPTIMAL03
START PRACTISING+