Tree left view 123

https://ide.codingblocks.com/s/57853
it is printing the whole tree values not the left view

the code is running perfectly fine…try it on this example :
1 2 -1 -1 3 -1 5 -1 -1

but it is showing wrong answer while submitting

and for right view do right call first

To print left view, store one element for every level in an array that one element will be the first element stored in the level array if a element is stored for a level then don’t update else update it.

@AASTHA011 https://ide.codingblocks.com/s/58635 last link was wrong
you can refer this line of code

this link is not wrong

this link is not working

@AASTHA011 no last one that i send was not working properly…