Shortest Path LeetCode Problems: All 27,
With Python Solutions
Every problem in this library that LeetCode tags Shortest Path. 19 of them carry a complete Python solution, a worked example and the time and space complexity of the approach.
- Easy
- 0
- Medium
- 15
- Hard
- 12
Shortest Path problems by difficulty
Problems with a complete Python solution are listed first, then by ascending problem number.
Medium (15)
| No. | Problem | Topics |
|---|---|---|
| 0399 | Evaluate Division | |
| 0743 | Network Delay Time | |
| 0787 | Cheapest Flights Within K Stops | |
| 1334 | Find the City With the Smallest Number of Neighbors at a Threshold Distance | |
| 1514 | Path with Maximum Probability | |
| 1786 | Number of Restricted Paths From First to Last Node | |
| 1976 | Number of Ways to Arrive at Destination | |
| 2662 | Minimum Cost of a Path With Special Roads | |
| 2976 | Minimum Cost to Convert String I | |
| 0505 | The Maze IIPremium | |
| 1810 | Minimum Path Cost in a Hidden GridPremium | |
| 2093 | Minimum Cost to Reach City With DiscountsPremium | |
| 2297 | Jump Game VIIIPremium | |
| 2473 | Minimum Cost to Buy ApplesPremium | |
| 2737 | Find the Closest Marked NodePremium |
Hard (12)
Eyes only
When the Shortest Path problem arrives live.
In the live round, Stealth Interview reads the problem off your screen, returns a working solution with a step-by-step explanation and its time and space complexity, and transcribes what the interviewer says. It's a desktop app for macOS and Windows, invisible to screen sharing.
Keep exploring
Other topics
- Array1,569
- String672
- Hash Table588
- Math485
- Dynamic Programming481
- Sorting392
- Greedy346
- Depth-First Search289
- Binary Search253
- Database249
- Tree225
- Breadth-First Search223
- Matrix216
- Two Pointers201
- Bit Manipulation194
- Binary Tree174
- Heap (Priority Queue)163
- Prefix Sum157
- Stack157
- Simulation144
- Graph138
- Counting126
- Design122
- Sliding Window116