func floydWarshall(_ weights: [[Int]], _ numVertices: Int) { var dist = Array(repeating: Array(repeating: Double.infinity, count: numVertices), count: numVertices) var next = Array(repeating: Array(repeating: 0, count: numVertices), count: numVertices) for weight in weights { dist[weight[0] - 1][weight[1] - 1] = Double(weight[2]) } for i in 0..