Given the root of a binary tree, return its diameter — the length (number of edges) of the longest path between any two nodes. The path may or may not pass through the root. The tree is given as a level-order array with null for missing children.
Input: A level-order array of the tree.
Output: Integer — the diameter in edges.
Input: [1,2,3,4,5,null,6]
Output: 4
Explanation: Longest path spans 4 edges, e.g. 4-2-1-3-6.Input: [1,2]
Output: 1
Explanation: One edge.Input: [1]
Output: 0
Explanation: Single node, no edges.0<=nodes<=10^4-1000<=value<=1000