static int getIndex ( String s1 , String s2 , int len ) {
  int i = 0 , j = len - 1 ;
  while ( i < j ) {
    if ( s1 . charAt ( i ) != s2 . charAt ( j ) ) {
      break ;
    }
    i ++ ;
    j -- ;
  }
  if ( i == j ) {
    return i - 1 ;
  }
  else if ( isPalindrome ( s2 , i , j ) ) return i - 1 ;
  else if ( isPalindrome ( s1 , i , j ) ) return j ;
  return - 1 ;
}

static int getIndex ( String s1 , String s2 , int len ) { int i = 0 , j = len - 1 ; while ( i < j ) { if ( s1 . charAt ( i ) != s2 . charAt ( j ) ) { break ; } i ++ ; j -- ; } if ( i == j ) { return i - 1 ; } else if ( isPalindrome ( s2 , i , j ) ) return i - 1 ; else if ( isPalindrome ( s1 , i , j ) ) return j ; return - 1 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (block (break_statement))) (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (return_statement (binary_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) consequence: (return_statement (binary_expression left: (identifier) right: (decimal_integer_literal))) alternative: (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) consequence: (return_statement (identifier))))) (return_statement (unary_expression operand: (decimal_integer_literal)))))