Binary Tree Right Side View

Leetcode Q: 199 Binary Tree Right Side View

CODE: https://ide.codingblocks.com/s/661307

This code is giving wrong answer. Why? I have used the same approach that prateek bhaiya had used in his video.

hi @bansalrahul409_90a31cb29d673b6d,
pass maxlevel by reference int &maxlevel so that it doesnot change values in different call stack

updated the code https://ide.codingblocks.com/s/661314

1 Like

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.