Atlassian OA

跟这个一样 geeksforgeeks:

Given a graph (Number of edges, number of nodes, From and To node pairs), you need to find the minimum weighted path from the first node(1) to the last node(N) and return it’s weight. If there exists no edge between any two vertices which would be required to complete the path from the first to the last node, then an edge can be created between them with the weight 1.