Coding
Count nodes in a complete binary tree.
Given the root of a complete binary tree, return the number of the nodes in the tree. In a complete binary tree, every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible.
Input: root = [1,2,3,4,5,6,7]
Output: 7
Explanation: The lowest level is completely filled, forming a perfect binary tree with 8 - 1 = 7 nodes.
Was asked at