Increasing Order Search Tree
Easy · Binary Search Trees · about 10 minutes
Asked at Amazon, Google, Meta.
Reshape a binary search tree into a chain that runs strictly to the right: the smallest value becomes the new root, nobody has a left child, and following right pointers lists the values in ascending order. Return the new root.