You are given a binary tree root, the value target of one node in it, and a number k. Return the values of all the nodes that are exactly k edges away from the target node. A step can go down to a child or up to the parent. You may return the values in any order.
How the judge passes the data
Examples
Example 1:
Input: root = [10,5,15,3,7,12,20,null,null,6,8], target = 5, k = 2
Output: [15,6,8]
Explanation: From 5, two steps down through 7 reach 6 and 8. Two steps through the parent 10 reach 15.
Example 2:
Input: root = [10,5,15,3,7,12,20,null,null,6,8], target = 15, k = 1
Output: [10,12,20]
Explanation: One step from 15: its parent 10 and its children 12 and 20.
Example 3:
Input: root = [4], target = 4, k = 0
Output: [4]
Explanation: A distance of 0 is the target node itself.