Why is my code showing run time error?

i have written the code for the problem check if the given tree is height balanced or not . my logic is correct but then also online editor shows run error while submitting. the output is also coming correct. please help

@Usha24 it is giving segmentation fault when I ran it…for which input did you try?

true 10 true 20 true 40 false false true 50 false false true 30 true 60 false false true 73 false false

got my mistake. i was taking ( “true” or “false” ) input for root node also.

thats why the code was node working. corrcted the mistake. thanks.

@Usha24 glad you found the mistake on your own :slight_smile: please mark the doubt as resolved.