I have checked my solution on local machine with various test-cases I could imagine, every time it gives correct answer but when I submit on codingBlocks, the test-cases 3, 4, 5 and 6 gives Run Error.
Is there any problem with my solution ?
I have checked my solution on local machine with various test-cases I could imagine, every time it gives correct answer but when I submit on codingBlocks, the test-cases 3, 4, 5 and 6 gives Run Error.
Is there any problem with my solution ?
return isMirror(root->left, root->right); Make it as
return isMirror(root, root); and then check. If this doesn’t work . Do let me know.
Used return isMirror(root, root); instead of isMirror(root->left, root->right); but still giving Run Error
The way you are taking input is causing TLE,
check now =>
Also you can try to submit your above code here, it is getting accepted.
Thanks, the problem with my previous solution was that it was taking input just from first line. Now, after modification solution has passed all the test cases.
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.