Given the root of a binary tree, return its minimum depth — the number of nodes along the shortest path from the root to its nearest leaf. A leaf is a node with no children. An empty tree has depth 0. 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 minimum depth.
Input: [1,2,3,4,5,null,6]
Output: 3
Explanation: Nearest leaf is at depth 3.Input: [1,2]
Output: 2
Explanation: One child path.Input: []
Output: 0
Explanation: Empty tree.0<=nodes<=10^4-1000<=value<=1000