Javascript – Diameter of a binary tree – failing case when the longest path doesn't pass through the root
So I'm working on this problem: Given the root of a binary tree, return the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in…