My code passes only 1 test case. Couldn’t find any error in it. My code link:
Print all nodes at distance k
Hey @nikhil015 ,

In the above image when you are getting your target node you are printing nodes which are k levels below the target element only . There might be the case where the element will have a node that is an ancetor of the node and k level above which should also be inclueded in the answer but your code (printAtLevelK) is not doing that. So try and include that condition as well the code should work fine after that i presume .
If you still have any further queries you can ask here
Hope it helps ! Happy coding !