Given the root of a binary tree, return the number of half nodes — nodes that have exactly one child (either left or right, but not both). 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 number of half nodes.
Input: [1,2,3,4,null,null,7]
Output: 2
Explanation: Nodes 2 and 3 each have exactly one child.Input: [1,2,3]
Output: 0
Explanation: No half nodes.Input: [1,2]
Output: 1
Explanation: Root has one child.0<=nodes<=10^4-1000<=value<=1000