Matrix • Intermediate • 20 min
Spiral Matrix
How to walk a matrix in layers using clear top bottom left right boundaries instead of scattered conditions.
Practice problems with walkthroughs, hints, and solutions.
Filter by type or level
Matrix • Intermediate • 20 min
How to walk a matrix in layers using clear top bottom left right boundaries instead of scattered conditions.
Dynamic Programming • Intermediate • 22 min
How to start from [O(n²)](/glossary/o-n-squared) [dynamic programming](/glossary/dynamic-programming) and reach the idea of smallest possible endings with [binary search](/glossary/binary-search).
Graphs • Intermediate • 20 min
How to deep-copy a graph with cycles by keeping a clear mapping from old nodes to new ones.
Trees • Intermediate • 18 min
How to search for a real subtree by comparing shape and values, not just roots that seem to match.
Trees • Intermediate • 15 min
How to use inorder traversal to exploit the BST ordering and stop as soon as the counter reaches k.
Intervals • Intermediate • 20 min
How to find how many meetings are active at the same time by tracking starts and ends in order.
Backtracking • Intermediate • 20 min
How to use controlled [backtracking](/glossary/backtracking) to build unique combinations in canonical order.
Trie • Intermediate • 25 min
How to use a [`Trie`](/glossary/trie) with [`DFS`](/glossary/dfs) to support the `.` wildcard through controlled branching.