Given a binary tree, return the length of its diameter: the number of edges on the longest path between any two nodes.
The path does not have to pass through the root.
The tree is given as a level-order array with explicit nulls, where the children of index i sit at 2i + 1 and 2i + 2. An empty array is an empty tree.