Given n nodes labeled 0 … n−1 and a list of undirected edges, return true if the edges form a valid tree: connected and acyclic.
Input
n mu vOutput: true or false.
5 4 0 1 0 2 0 3 1 4
true
5 5 0 1 1 2 2 3 1 3 1 4
false
1-2-3 forms a cycle.
Run your code against the sample tests, or Submit to run the full suite.