public void helper(TreeNode root) {
        if (root == null) {
            res += "# ";
            return;
        }
        res += String.valueOf(root.val) + " ";
        helper(root.left);
        helper(root.right);
    }