public String getString(String s, int left, int right) {
        while (left >= 0 && right < s.length()
                && s.charAt(left) == s.charAt(right)) {
            --left;
            ++right;
        }
        return s.substring(++left, right);
    }