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.
Run Dijkstra from the last node, then count paths that step only to strictly closer nodes, in increasing distance order.