Example 1

1 <= n <= 1000 <= edges.length <= n * (n - 1)edges[i].length == edge.length == 30 <= fromi, toi, from, to, node1, node2 <= n - 11 <= edgeCosti, edgeCost <= 106There are no repeated edges and no self-loops in the graph at any point.At most 100 calls will be made for addEdge.At most 100 calls will be made for shortestPath.Example 1

1 <= n <= 1000 <= edges.length <= n * (n - 1)edges[i].length == edge.length == 30 <= fromi, toi, from, to, node1, node2 <= n - 11 <= edgeCosti, edgeCost <= 106There are no repeated edges and no self-loops in the graph at any point.At most 100 calls will be made for addEdge.At most 100 calls will be made for shortestPath.