1382. Balance a Binary Search Tree
Last updated
Last updated
**Input:** root = [1,null,2,null,3,null,4,null,null]
**Output:** [2,1,3,null,null,null,4]
**Explanation:** This is not the only correct answer, [3,1,4,null,2] is also correct.**Input:** root = [2,1,3]
**Output:** [2,1,3]