Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Leetcode 1786. Number of Restricted Paths From First to Last Node
Given a weighted undirected graph, count the number of paths from node 1 to node n such that the shortest distance-to-node-n strictly decreases at every step, returning the result modulo 1e9+7. This requires computing distances to node n and then counting monotone-decreasing paths according to that distance ordering.
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Mid October, 2024
Junior
Find the shortest path in an undirected unweighted graph from start to end node, avoiding restricted nodes
Mid October, 2024
Junior
Find the minimum number of passes needed to reach the end node in a graph, where passes are required to cross restricted nodes
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.