Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Google
Leetcode 1786. Number of Restricted Paths From First to Last Node
Reported Oct 16, 2024 · 1 source report
JUNIOR
Source snapshot: Nov 12, 2026
View source