static int [ ] kmp ( char [ ] ca ) {
  int [ ] kmp = new int [ ca . length ] ;
  int N = ca . length ;
  for ( int i = 1 ;
  i < N ;
  i ++ ) {
    int p = kmp [ i - 1 ] ;
    while ( p > 0 && ca [ p ] != ca [ i ] ) {
      p = kmp [ p - 1 ] ;
    }
    if ( ca [ p ] == ca [ i ] ) p ++ ;
    kmp [ i ] = p ;
  }
  return kmp ;
}

static int [ ] kmp ( char [ ] ca ) { int [ ] kmp = new int [ ca . length ] ; int N = ca . length ; for ( int i = 1 ; i < N ; i ++ ) { int p = kmp [ i - 1 ] ; while ( p > 0 && ca [ p ] != ca [ i ] ) { p = kmp [ p - 1 ] ; } if ( ca [ p ] == ca [ i ] ) p ++ ; kmp [ i ] = p ; } return kmp ; }
(method_declaration (modifiers) type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier))))) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) consequence: (expression_statement (update_expression (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))))) (return_statement (identifier))))