Please have a look into my code and rectify the errors.
Please check my code
@kodivine0 output must be in sorted format, so don’t print nodes directly, instead store them in a vector, then sort and print!
sir, i have made the correction but still 1 test case is failing.
you have to print 0 when there is no node at distance k (or i==0)