Search
⌘K

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:

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid October, 2024

Google

Google

Junior

Find the minimum number of passes needed to reach the end node in a graph, where passes are required to cross restricted nodes

Mid October, 2024

Google

Google

Junior

Find the shortest path in an undirected unweighted graph from start to end node, avoiding restricted nodes

Comments

Your account is free and you can post anonymously if you choose.