https://ide.codingblocks.com/s/59614 please help me with this code I got three test case failed and one got pass. please suggest me what’s wrong in my code
.
Print all node from distance k
Hi Neeraj, consider the following test case:
Input:
15
12 10 17 22 20 85 74 38 23 64 46 51 65 99 87
10 12 17 20 22 23 38 46 51 64 65 74 85 87 99
1
85 2
Expected Output: 17 20 38 87
Your code’s ouput: 38 87 17
The order of printing is also not correct as well as some nodes are missing.