Floyd Warshall All Pairs

Given a graph with n vertices and weighted edges, find all-pairs shortest distances using Floyd-Warshall algorithm.

Examples
Input: [3,[[0,1,2],[1,2,1]]]
Output: [[0,2,3],[-1,0,1],[-1,-1,0]]
Hints

Floyd Warshall All Pairs

Given a graph with n vertices and weighted edges, find all-pairs shortest distances using Floyd-Warshall algorithm.