A tree is an undirected graph where any two vertices are connected by exactly one path. Given a tree of n nodes labeled from 0 to n - 1 and an array of n - 1 edges indicating undirected edges, you can select any node as the root. The tree height is the number of edges on the longest path between the root and a leaf. Return a list of root labels resulting in minimum height trees (MHTs).
Click Run to execute sample tests.