https://hack.codingblocks.com/contests/c/537/1604
https://ide.codingblocks.com/s/70052
The problem with my code is that I am not able to understand how to look for the sibling nodes. I am able to find and print ancestor and descendant nodes which are at ‘k’ distance but not to able to work for the sibling nodes.
I am not even able to pass the given sample case in the problem as the second testcase requires printing the sibling node
Please suggest some approach or modification to the code .