Challenge: Number of Full Nodes in a Binary Tree

Let’s count the number of full nodes in a binary tree.


Given a binary tree, find the count of full nodes in it. A full node has non-null left and right children.


A binary tree.


The number of full nodes.

Sample input

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.