Given an undirected tree with n nodes labeled from 0 to n−1, represented by a 2D array edges where edges.length==n−1. Each edges[i]=[ai,bi] denotes an undirected edge between nodes ai and bi. Your task is to return the diameter of the tree.
The diameter of a tree is the number of ...