Nodes at k distance


I cant understand why one test case is failing (out of 4)


made two small changes and it passes all the test cases, u need to call on the right tree after the call for left is complete
and returned zero for cases when v is empty i.e. no root at dist k

1 Like