Find the diameter of a tree with nodes and edges. Unlike the binary tree version, nodes can have any number of children. The input is an adjacency list, not pointer-based TreeNode objects.
The DP approach from LC still works here, but Double BFS gives a cleaner solution for general trees. You will solve this problem fully in the Tree Diameter & Center section using Double BFS. That section also compares both approaches side by side so you can see when each one fits better.