Nodes at a distance K

https://ide.codingblocks.com/s/364336

Please debug it. I can’t understand where’s the error.

Hey @anindya-gupta
Mentioned the changes in comments : https://ide.codingblocks.com/s/364344

It still gives WA for 2 cases for them instead of printing store all the nos in vector and print after sorting.

On T lines print space separated desired output for each test case in sorted form

I did that still one test case remains.

Hey @anindya-gupta
replace

		if(result==-1){
			cout<<"-1";
		}

by

if(v.size()==0)cout<<0;