rewrite leetcode same tree