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)

Medium problems
No.Problem
0399Evaluate Division
0743Network Delay Time
0787Cheapest Flights Within K Stops
1334Find the City With the Smallest Number of Neighbors at a Threshold Distance
1514Path with Maximum Probability
1786Number of Restricted Paths From First to Last Node
1976Number of Ways to Arrive at Destination
2662Minimum Cost of a Path With Special Roads
2976Minimum Cost to Convert String I
0505The Maze IIPremium
1810Minimum Path Cost in a Hidden GridPremium
2093Minimum Cost to Reach City With DiscountsPremium
2297Jump Game VIIIPremium
2473Minimum Cost to Buy ApplesPremium
2737Find the Closest Marked NodePremium

Hard (12)

Hard problems
No.Problem
0882Reachable Nodes In Subdivided Graph
1368Minimum Cost to Make at Least One Valid Path in a Grid
2045Second Minimum Time to Reach Destination
2203Minimum Weighted Subgraph With the Required Paths
2290Minimum Obstacle Removal to Reach Corner
2577Minimum Time to Visit a Cell In a Grid
2642Design Graph With Shortest Path Calculator
2699Modify Graph Edge Weights
2959Number of Possible Sets of Closing Branches
2977Minimum Cost to Convert String II
0499The Maze IIIPremium
2714Find Shortest Path with K HopsPremium

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.