You are given n nodes labeled 0 to n - 1 and a list of undirected edges. Return true if these edges form a valid tree.
A graph is a valid tree exactly when it is fully connected (every node is reachable) and contains no cycle. Equivalently: it is connected and has exactly n - 1 edges.
5, [[0,1],[0,2],[0,3],[1,4]]5, [[0,1],[1,2],[2,3],[1,3],[1,4]]1, []2, []4, [[0,1],[2,3]]3, [[0,1],[1,2],[2,0]]4, [[0,1],[1,2],[2,3]]