Find all roots that minimize the height of an undirected tree using graph algorithms.
Constraints
Example
```python # Example 1 n = 4 edges = [[1,0],[1,2],[1,3]] print(find_min_height_roots(n, edges)) # Output: [1] # Example 2 n = 6 edges = [[3,0],[3,1],[3,2],[3,4],[5,4]] print(find_min_height_roots(n, edges)) # Output: [3,4] # Example 3 n = 1 edges = [] print(find_min_height_roots(n, edges)) # Output: [0] ```
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints