Why re two testcases not passing?

How to account for when target node is found in the tree but there there no value at kth distance.
eg
7
20 8 4 12 10 14 22
4 8 10 12 14 20 22
1
14 5

Hey
As per the question, Print 0 if no such node exist at distance k.

what is wrong with code , ek case pass nhi ho raha hai ?

Can someone pls tell me why isnt one testcase passing?

Hey please share the link of your code here

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.