public boolean check(String s) {
        if (s.length() == 1)
            return true;
        int begin = 0, end = s.length() - 1;
        while (begin < end) {
            if (s.charAt(begin) != s.charAt(end))
                return false;
            ++begin;
            --end;
        }
        return true;
    }