Matrix
2D arrays; your first concrete DFS/backtracking, setting up for graphs.
Lessons
- ✓01
Recognizing matrix problems
Thinking in 2D: (row, column) coordinates, neighbors, bounds, and the O(m·n) complexity.
- ✓02
Pattern 1: Layer-by-layer traversal (spiral)
Walking the matrix in a spiral by controlling four shrinking bounds.
- ✓03
Pattern 2: In-place transformation
Rotating the image and zeroing rows/columns without an auxiliary matrix — just index tricks.
- ✓04
Pattern 3: DFS on a grid (flood fill)
Treating the grid as a graph: flooding connected regions with depth-first search.
- ✓05
Pattern 4: Backtracking on a grid
Exploring paths by marking and unmarking cells — the word search.
- ✓06
Pattern 5: BFS on a grid (shortest path)
When the question is 'the shortest', breadth-first search explores layer by layer.
- ✓07
Synthesis: which pattern to use?
The Matrix section's decision tree and the general quiz before the final exam.
1 easy + 1 medium + 1 hard — unseen problems
With hidden test cases, just like the real LeetCode. This is where you confirm you can leave the section solving any problem of the topic.