1466. Reorder Routes to Make All Paths Lead to the City Zero
Previous1465. Maximum Area of a Piece of Cake After Horizontal and Vertical CutsNext1467. Probability of a Two Boxes Having The Same Number of Distinct Balls
Last updated
Last updated
**Input:** n = 6, connections = [[0,1],[1,3],[2,3],[4,0],[4,5]]
**Output:** 3
**Explanation:** Change the direction of edges show in red such that each node can reach the node 0 (capital).**Input:** n = 5, connections = [[1,0],[1,2],[3,2],[3,4]]
**Output:** 2
**Explanation:** Change the direction of edges show in red such that each node can reach the node 0 (capital).**Input:** n = 3, connections = [[1,0],[2,0]]
**Output:** 0