Given the root of a binary tree and an integer k, return the values of all nodes at distance k from the root (the root is at distance 0), in left-to-right order. Return an empty array if no node is at that distance. The input gives a level-order tree array and k separated by ' | '.
Input: A level-order tree array and k, separated by ' | '.
Output: Array — node values at distance k.
Input: [1,2,3,4,5,null,7] | 2
Output: [4,5,7]
Explanation: Nodes two levels below the root.Input: [1,2,3] | 1
Output: [2,3]
Explanation: Children of the root.Input: [1] | 0
Output: [1]
Explanation: Root itself.0<=nodes<=10^40<=k<=height-1000<=value<=1000