Nodes at a Distance K in a binary tree

I don’t understand this code can you please explain it another way.

@rohit_2425
There is already a video on explanation of this question, i will suggest you to please have a look at it first, then look at this code’s video. I am sure it will be clear then.
If you have any specific doubt after that, then you can ask here again.
Feel free to ask.

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.