Print all nodes at distance k .it pass two cases plz check what i am doing wrong

sol - https://ide.codingblocks.com/s/236704

you have’nt handled the case where no such node exist at distance k in that case you have to print 0.
also at line 69 and 80 it should be a!=-1 and b!=-1 instead of == as a==-1 represent the node is not present in left subtree so you have to then check for right subtree

here you can check your code with this code :-