1666. Change the Root of a Binary Tree
Last updated
Last updated
**Input:** root = [3,5,1,6,2,0,8,null,null,7,4], leaf = 7
**Output:** [7,2,null,5,4,3,6,null,null,null,1,null,null,0,8]**Input:** root = [3,5,1,6,2,0,8,null,null,7,4], leaf = 0
**Output:** [0,1,null,3,8,5,null,null,null,6,2,null,null,7,4]