Regarding sample test case ( Find maximum at each level )

In this question, the given level order traversal is incomplete as it has only 4 -1 s. Please look into this as my code is giving run time error due to this.

Yes there must be 8 -1s. You are given a level order input.
But this must not give an error. By default left and right of each node is initialized as NULL.

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.