Consider a binary tree, a target node, and an integer k. Return all nodes that are exactly distance k from the target. Google uses this to test your ability to convert trees into graphs and perform BFS from an arbitrary node.
For example, in a tree rooted at with children and , if target = 5 and k = 2, the answer includes node (up to , down to ) and nodes and in the subtree of . Distance counts edges, not nodes.
The twist: binary trees only have downward pointers. How do you go upward from the target?