Reorder Routes to Make All Paths Lead to the City Zero

Given n cities numbered 0 to n - 1 with n - 1 undirected roads between them, implement solve(n, edges). Reorient every road so all paths lead to city 0. Return the minimum number of roads that must be reoriented.

Examples
Input: [6,[[0,1],[1,3],[2,3],[4,0],[4,5]]]
Output: 3
Hints

Reorder Routes to Make All Paths Lead to the City Zero

Given `n` cities numbered `0` to `n - 1` with `n - 1` undirected roads between them, implement `solve(n, edges)`. Reorient every road so all paths lead to city `0`. Return the minimum number of roads that must be reoriented.