static int getMinCharToAddedToMakeStringPalin ( String str ) {
  StringBuilder s = new StringBuilder ( ) ;
  s . append ( str ) ;
  String rev = s . reverse ( ) . toString ( ) ;
  s . reverse ( ) . append ( "$" ) . append ( rev ) ;
  int lps [ ] = computeLPSArray ( s . toString ( ) ) ;
  return str . length ( ) - lps [ s . length ( ) - 1 ] ;
}

static int getMinCharToAddedToMakeStringPalin ( String str ) { StringBuilder s = new StringBuilder ( ) ; s . append ( str ) ; String rev = s . reverse ( ) . toString ( ) ; s . reverse ( ) . append ( " $ " ) . append ( rev ) ; int lps [ ] = computeLPSArray ( s . toString ( ) ) ; return str . length ( ) - lps [ s . length ( ) - 1 ] ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list (string_literal))) name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (return_statement (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (array_access array: (identifier) index: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))))))