My code is not passing any test case


please help

hi @ikshuldureja130
its just a simple ques to count no of nodes in tree…
refer this ->

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

the code you referred has O(n) time complexity…I am trying to implement it in O(logn) time complexity…my code is passing all cases on leetcode but it is not passing any test case on coding blocks…please tell me error in my code

hi @ikshuldureja130
there must be some compiler issues, that’s why it not passing on coding blocks… rest ur code seems fine and I also tried ur code on leetcode, it works fine there… so don’t worry u can move ahead with other questions…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.