Shortest Path Problems
Master shortest path problems with AI-powered solutions. Get instant coding assistance during your technical interviews for all 22 problems in this category.
Total Problems: 22
Medium: 12
Hard: 10
Showing 22 of 22 problems
Problems
Scroll within this area to browse all problems
#
Title
Difficulty
Shortest Path LeetCode Problems List
- 803. Cheapest Flights Within K Stops - Medium - Shortest PathThere are n cities connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is... Topics: Dynamic Programming, Depth-First Search, Breadth-First Search, Graph, Heap (Priority Queue), Shortest Path
- 399. Evaluate Division - Medium - Shortest PathYou are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equa... Topics: Array, String, Depth-First Search, Breadth-First Search, Union Find, Graph, Shortest Path
- 744. Network Delay Time - Medium - Shortest PathYou are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (ui, vi, wi), w... Topics: Depth-First Search, Breadth-First Search, Graph, Heap (Priority Queue), Shortest Path
- 3627. Find Minimum Time to Reach Last Room I - Medium - Shortest PathThere is a dungeon with n x m rooms arranged as a grid. You are given a 2D array moveTime of size n x m, where moveTime[i][j] represents the minimum t... Topics: Array, Graph, Heap (Priority Queue), Matrix, Shortest Path
- 2171. Second Minimum Time to Reach Destination - Hard - Shortest PathA city is represented as a bi-directional connected graph with n vertices where each vertex is labeled from 1 to n (inclusive). The edges in the graph... Topics: Breadth-First Search, Graph, Shortest Path
- 2686. Minimum Cost of a Path With Special Roads - Medium - Shortest PathYou are given an array start where start = [startX, startY] represents your initial position (startX, startY) in a 2D space. You are also given the ar... Topics: Array, Graph, Heap (Priority Queue), Shortest Path
- 3919. Network Recovery Pathways - Hard - Shortest PathYou are given a directed acyclic graph of n nodes numbered from 0 to n − 1. This is represented by a 2D array edges of length m, where edges[i] = [ui,... Topics: Array, Binary Search, Dynamic Programming, Graph, Topological Sort, Heap (Priority Queue), Shortest Path
- 1456. Find the City With the Smallest Number of Neighbors at a Threshold Distance - Medium - Shortest PathThere are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge b... Topics: Dynamic Programming, Graph, Shortest Path
- 1485. Minimum Cost to Make at Least One Valid Path in a Grid - Hard - Shortest PathGiven an m x n grid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently in this cell. The sign of grid[i... Topics: Array, Breadth-First Search, Graph, Heap (Priority Queue), Matrix, Shortest Path
- 2090. Number of Ways to Arrive at Destination - Medium - Shortest PathYou are in a city that consists of n intersections numbered from 0 to n - 1 with bi-directional roads between some intersections. The inputs are gener... Topics: Dynamic Programming, Graph, Topological Sort, Shortest Path
- 3916. Minimum Time to Reach Destination in Directed Graph - Medium - Shortest PathYou are given an integer n and a directed graph with n nodes labeled from 0 to n - 1. This is represented by a 2D array edges, where edges[i] = [ui, v... Topics: Graph, Heap (Priority Queue), Shortest Path
- 2678. Design Graph With Shortest Path Calculator - Hard - Shortest PathThere is a directed weighted graph that consists of n nodes numbered from 0 to n - 1. The edges of the graph are initially represented by the given ar... Topics: Graph, Design, Heap (Priority Queue), Shortest Path
- 918. Reachable Nodes In Subdivided Graph - Hard - Shortest PathYou are given an undirected graph (the "original graph") with n nodes labeled from 0 to n - 1. You decide to subdivide each edge in the graph into a c... Topics: Graph, Heap (Priority Queue), Shortest Path
- 3720. Minimize the Maximum Edge Weight of Graph - Medium - Shortest PathYou are given two integers, n and threshold, as well as a directed weighted graph of n nodes numbered from 0 to n - 1. The graph is represented by a 2... Topics: Binary Search, Depth-First Search, Breadth-First Search, Graph, Shortest Path
- 2803. Modify Graph Edge Weights - Hard - Shortest PathYou are given an undirected weighted connected graph containing n nodes labeled from 0 to n - 1, and an integer array edges where edges[i] = [ai, bi, ... Topics: Graph, Heap (Priority Queue), Shortest Path
- 3896. Minimum Time to Transport All Individuals - Hard - Shortest PathYou are given n individuals at a base camp who need to cross a river to reach a destination using a single boat. The boat can carry at most k people a... Topics: Array, Dynamic Programming, Bit Manipulation, Graph, Heap (Priority Queue), Shortest Path, Bitmask
- 3558. Find a Safe Walk Through a Grid - Medium - Shortest PathYou are given an m x n binary matrix grid and an integer health. You start on the upper-left corner (0, 0) and would like to get to the lower-right co... Topics: Array, Breadth-First Search, Graph, Heap (Priority Queue), Matrix, Shortest Path
- 1325. Path with Maximum Probability - Medium - Shortest PathYou are given an undirected weighted graph of n nodes (0-indexed), represented by an edge list where edges[i] = [a, b] is an undirected edge connectin... Topics: Array, Graph, Heap (Priority Queue), Shortest Path
- 3235. Minimum Cost to Convert String I - Medium - Shortest PathYou are given two 0-indexed strings source and target, both of length n and consisting of lowercase English letters. You are also given two 0-indexed ... Topics: Array, String, Graph, Shortest Path
- 2375. Minimum Obstacle Removal to Reach Corner - Hard - Shortest PathYou are given a 0-indexed 2D integer array grid of size m x n. Each cell has one of two values: 0 represents an empty cell, 1 represents an obstacle t... Topics: Array, Breadth-First Search, Graph, Heap (Priority Queue), Matrix, Shortest Path
- 2321. Minimum Weighted Subgraph With the Required Paths - Hard - Shortest PathYou are given an integer n denoting the number of nodes of a weighted directed graph. The nodes are numbered from 0 to n - 1. You are also given a 2D ... Topics: Graph, Shortest Path
- 3386. Find Edges in Shortest Paths - Hard - Shortest PathYou are given an undirected weighted graph of n nodes numbered from 0 to n - 1. The graph consists of m edges represented by a 2D array edges, where e... Topics: Depth-First Search, Breadth-First Search, Graph, Heap (Priority Queue), Shortest Path
Related LeetCode Topics
- Array LeetCode Problems
- Backtracking LeetCode Problems
- Biconnected Component LeetCode Problems
- Binary Indexed Tree LeetCode Problems
- Binary Search LeetCode Problems
- Binary Search Tree LeetCode Problems
- Binary Tree LeetCode Problems
- Bit Manipulation LeetCode Problems
- Bitmask LeetCode Problems
- Brainteaser LeetCode Problems
- Breadth-First Search LeetCode Problems
- Bucket Sort LeetCode Problems
- Combinatorics LeetCode Problems
- Concurrency LeetCode Problems
- Counting LeetCode Problems
- Counting Sort LeetCode Problems
- Data Stream LeetCode Problems
- Database LeetCode Problems
- Depth-First Search LeetCode Problems
- Design LeetCode Problems