rewrite leetcode recover binary search tree