import java.util.*;

public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param A string字符串 * @return int整型 */ public int getLongestPalindrome (String A) { int max = 0; int lengthA = A.length();

	for (int i = 0; i < lengthA; ) {
		int begin = i;
		int end = i;
		while (end < lengthA - 1 && A.charAt(end) == A.charAt(end + 1)) {
			end++;
		}
		i = end + 1;
		while (begin > 0 && end < lengthA - 1 && A.charAt(begin - 1) == A.charAt(end + 1)) {
			begin--;
			end++;
		}
		max = Math.max(max, end - begin +1);
	}
	
	return max;
}

}