Largest value in each level

question–>
https://practice.geeksforgeeks.org/problems/largest-value-in-each-level/1/?category[]=Tree&category[]=Tree&problemStatus=unsolved&difficulty[]=-1&difficulty[]=0&page=1&query=category[]TreeproblemStatusunsolveddifficulty[]-1difficulty[]0page1category[]Tree
code–>


the code is not giving correct answer

Hello @sheikhhaji18 could you please explain your approach?
So it could be way easy to find the mistake.

bro i am using level traversal and the for loop (it traverses all the elements of a level)

ohh sorry stupid mistake i did not push the root first

so did you get the mistake?

yes u can mark it 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.

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.