Relevant Patterns
#Study these pattern guides before tackling the problems. Understanding the core concepts will help you solve them more efficiently.
Practice Problems
#Medium#743
Show 2 hints
- Use Dijkstra from the source; answer is max distance or -1 if unreachable.
- Store adjacency as (to, weight); skip stale heap entries.
Medium#1631
Show 2 hints
- Binary search on answer + BFS, or Dijkstra on effort (max edge along path).
- Grid neighbors with abs height diff as weight.
Medium#787
Show 2 hints
- DP/Bellman-Ford variant on edges for up to K+1 layers.
- Alternatively use BFS/priority with (node, cost, stops) and prune by best [node][stops].
Medium#1091
Show 2 hints
- 8-direction BFS from (0,0); mark visited; return steps when reaching (n-1,n-1).
- Check starting/ending cell blocked cases.
Show 2 hints
- Run Dijkstra from each node (or Floyd–Warshall) and count neighbors ≤ threshold.
- Tie-break by city index descending if required.
Track Your Progress
Mark problems as complete as you solve them. Come back anytime to continue where you left off.