AlgoMaster Logo

Number of Ways to Arrive at Destination

n=7,roads=[[0,6,7],[0,1,2],[1,2,3],[1,3,3],[6,3,3],[3,5,1],[6,5,1],[2,5,1],[0,4,5],[4,6,2]]
0 / 45
72333111520123456startdestheapdist00123456ways01102030405060ways[6] = 0count the shortest paths from 0 to 6
algomaster.io
Step:Count the shortest paths from node 0 to node 6