Print all nodes at kdistance

getting all cases wrong while on custom case its correct.

The only issue with the code is that you’ve to print all those nodes which are at distance K in a sorted manner, so instead of directly printing them, you can use a vector to push the data of all the nodes which are at k distance from given node, and while printing the answer you can simply sort the vector and print all the nodes, I’ve made some changes in your code you can check it here.
Hope this helps

@Yashwardhan_Gautam
now also 3 case are wrong

check this out.

@Yashwardhan_Gautam
it worked but what was the mistake this time?