rewrite leetcode BST level search