public static boolean sym(TreeNode left, TreeNode right) {
        if (left == null) return right == null;//these two lines are concise!
        if (right == null) return left == null;
        if (left.val != right.val) return false;
        if (sym(left.left, right.right) && sym(left.right, right.left)) {
            return true;
        }
        return false;
    }