Given the root of a binary tree, determine whether all leaf nodes lie at the same depth. Return true or false. An empty tree is considered true. The tree is given as a level-order array with null for missing children.
Input: A level-order array of the tree.
Output: Boolean — true or false.
Input: [1,2,3]
Output: true
Explanation: Both leaves are at depth 1.Input: [1,2,3,4,null,null,5,6]
Output: false
Explanation: Leaves at different depths.Input: [1]
Output: true
Explanation: Single leaf.0<=nodes<=10^4-1000<=value<=1000