Problem 1786 · Medium

Number of Restricted Paths From First to Last Node

Run Dijkstra from the last node, then count paths that step only to strictly closer nodes, in increasing distance order.

Open the interactive visualisation