A directed graph has n nodes and edges[i] = [u, v, w] with positive weights (parallel edges are possible; use the cheapest). Return the cheapest route from from to to as an array of nodes, starting with from and ending with to, or [] if there is none. If from === to return [from].
- When several routes tie, any cheapest route is accepted; the tests check the route's validity and total cost
- Use Floyd-Warshall with a
next matrix (the first step of a best path from i to j), not a stored path per cell - V is at most 100