NODES AT DISTANCE K

https://ide.codingblocks.com/s/437378 please check my code, what is problem in it.

hello @CODER_JATIN

your code is correct . it just because of output format u r getting wa (they want output in sorted order).

so put all ur data in vector and then sort it and then print

bhaiya ,lekin output blank aa rhi hai , kuch bhi ni aara output mai?

@CODER_JATIN
a) u r not reading t
b) in ur nodeATlevel k function , add one more base case ie if (k<0) return;

Hanji Hanji , ho gya bhaiya , thank you :slight_smile:

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.