Tree Right View


what is wrong in my code?
only one test case passed

hi @akshitabansal321 try this test case
1 6 2 8 7 4 3 11 -1 9 -1 5 -1 -1 -1 -1 -1 10 -1 -1 -1 -1 -1
as is 1 2 3 5 10

yeah, this test case failed, but why?.. on leetcode it is showing right answer

hi @akshitabansal321 updated

ah! these silly mistakes i do. thankyou