Sir/Mam
How do i spot what is wrong with the code ?
Here is the link :
One test-case gone wrong
Hi @Ekram,
only checking the height will not work you also need to check whether there are both nodes on a parent node or only one … your code was failing there when one node had two children and the other had only one … according to your code they were identical.
check this code .-
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.
hi @Ekram
you are only checking through height but not checking when one node had two children and the other had only one
check this code