Given a complete binary tree, A, find the total number of nodes in the tree.
The first and the only argument of input contains a reference to the root of the complete binary tree.
Return an integer representing the number of nodes in the complete binary tree.
1 <= Number of nodes in the binary tree <= 1e5
Input 1: 1 / \ 2 3 Output 1: 3 Input 2: 1 / \ 2 3 / \ 4 5 Output 2: 5
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.