static int solve ( char [ ] s ) {
  for ( int len = s . length - 1 ;
  len > 0 ;
  len -- ) for ( int i = 0 ;
  i <= s . length - len ;
  i ++ ) for ( int k = i + 1 ;
  k <= s . length - len ;
  k ++ ) if ( match ( s , k , i , len ) ) {
    return len ;
  }
  return 0 ;
}

static int solve ( char [ ] s ) { for ( int len = s . length - 1 ; len > 0 ; len -- ) for ( int i = 0 ; i <= s . length - len ; i ++ ) for ( int k = i + 1 ; k <= s . length - len ; k ++ ) if ( match ( s , k , i , len ) ) { return len ; } return 0 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) update: (update_expression (identifier)) body: (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier)))) consequence: (block (return_statement (identifier))))))) (return_statement (decimal_integer_literal))))