Don't know why one test case is not passing , Please help

@Ramitgoel can u tell me what exactly you are doing to take input, because the problem lies in the buildTree part. It is not clear to me.
Rest part of the code is correct.

@sanyamsinghalmnnit
i am taking the level order input using queue
it’s working correct i suppose
please check it if its wrong
And i am having the same error in left view of tree i.e only 1 test case is not passed
please tell the error in this top view

@Ramitgoel the problem is with your buildTree() function only.
For eg:- 1 -1 2 -1 3 , this is the tree.
Your code is not taking the input correctly, you can check it by printing the tree itself.

Please have a look at my code, i have commented it properly. https://ide.codingblocks.com/s/240363

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.