public int[] findLongestPalindrome(String s,int i) {
        int start = i-1; 
        int end = i+1;
        while (start>=0&&end <s.length()){
            if (s.charAt(start) == s.charAt(end)){
                start --;
                end ++;
            }
            else
                break;
        }
        int[] result = {start+1,end-1};
        if (i<s.length()-1&&s.charAt(i)==s.charAt(i+1)) {
            start = i-1; end = i+2;
            while (start>=0&&end <s.length()){
                if (s.charAt(start) == s.charAt(end)){
                    start --;
                    end ++;
                }
                else
                    break;
            }
        }
        if (result[1]-result[0]<end -start-2) {
            result[0] = start+1;
            result[1] = end-1;
        }
        return result;
    }