please refer to the code and see why my solution is showing wrong answer
Please tell why the answer is showing wrong answer
@harryson make a new tree for every test case. You are just adding all the nodes to the previous tree itself.
Declare node*root = NULL inside the while loop and the problem will be resolved
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.