1602. Find Nearest Right Node in Binary Tree
Last updated
Last updated
**Input:** root = [1,2,3,null,4,5,6], u = 4
**Output:** 5
**Explanation:** The nearest node on the same level to the right of node 4 is node 5.**Input:** root = [3,null,4,2], u = 2
**Output:** null
**Explanation:** There are no nodes to the right of 2.**Input:** root = [1], u = 1
**Output:** null**Input:** root = [3,4,2,null,null,null,1], u = 4
**Output:** 2