passing only two cases
All nodes at k distance apart
assuming that u made the tree correct, u have to print the nodes in a sorted order.
besides this, the logic for the essential problem is correct
here is the correct code with comments
passing only two cases
assuming that u made the tree correct, u have to print the nodes in a sorted order.
besides this, the logic for the essential problem is correct
here is the correct code with comments