~/problems
Problems
Basics first, then the classics, then company-style assessments. Every problem has tests you run right here; multi-level ones unlock as you go. See the roadmap.
Interview roadmap
Weighted graphs
Dijkstra, union-find, spanning trees.
25 problems
Interview roadmap
Weighted graphs Dijkstra, union-find, spanning trees.
Dijkstra (weighted shortest paths) guide
- Play first: The Dragon's Cave 1-minute game Dijkstra's algorithm (shortest paths with a heap)
- The order Dijkstra settles nodes basics py · c++ · java easy
- Walk to the nearest open pharmacy py · c++ · java medium
- Network Delay Time code the boss py · c++ · java medium
- Shortest path with reconstruction py · c++ · java medium
- Path with Minimum Effort py · c++ · java medium
- Cheapest Flights Within K Stops py · c++ · java medium
- Cheapest route with one half-price coupon py · c++ · java medium
- Swim in Rising Water py · c++ · java hard
Union-Find guide
- Play first: The Eight Kingdoms 1-minute game Union-find
- Find the root of every node basics py · c++ · java easy
- Pooled lunch money py · c++ · java easy
- Union-Find class with component count py · c++ · java easy
- Number of Provinces code the boss py · c++ · java medium
- Redundant Connection py · c++ · java medium
- Accounts Merge py · c++ · java medium
- Graph Valid Tree py · c++ · java medium
- Number of Islands II py · c++ · java hard
More practice: 5 problems
- Pin board connectivity Pinterest py · c++ · java medium
- Minimum triggers to absorb all balls Uber py · c++ · java medium
- Smallest String With Swaps py · c++ · java medium
- Making a Large Island py · c++ · java hard
- Bricks Falling When Hit py · c++ · java hard
Minimum spanning tree guide
- Play first: The Road Builder 1-minute game Kruskal's algorithm (minimum spanning tree)
- Cheapest edge out of a group basics py · c++ · java easy
- Cheapest repairs to reconnect every city py · c++ · java medium
- Finish the irrigation network code the boss py · c++ · java medium
- Min Cost to Connect All Points py · c++ · java medium