Checking whether string s2 is palindrome and different from s .
if ( ( s == null ? s2 != null : ! s . equals ( s2 ) ) && isPalindrome ( s2 ) ) { return true ; } } return false ; } static int solve ( String s ) {