...

/

Challenge 5: Finding Nodes at "k" Distance From the Root

Challenge 5: Finding Nodes at "k" Distance From the Root

If you are given the root to a binary search tree and a node value k, can you write a code to find the nodes at k distance from the root?

Problem statement

Implement a function string findKNodes(Node* root, int k) , ...