What’s wrong in this code why it is giving a tle
Https://ide.codingblocks.com/s/469693
hello @nitinchoudhary260
dont call count nodes function again n again this will make ur program slow.
call only once and store its result in some vairable .
and use that variable whenever u need count of nodes
okk Thanks for the explaination
check now->
It’s still giving time limit exceeded
pls clear ur cache and try to submit again
working fine on my side->

Yeah it is working now Thanks for the updation
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.