Giving wrong answer, although sample test case are running perfectly

Plz, have a look at my code…

hello @rabhi1611
image

here u need to find number of nodes in ur current subtree instead of height.

ooh, thanks, it works.