Google interview question

leetcode question about deleting a subtree