private static int solve ( String stdinString ) {
  String [ ] splits = stdinString . split ( "\n" ) ;
  int N = Integer . parseInt ( splits [ 0 ] ) ;
  int [ ] nums = new int [ N ] ;
  splits = splits [ 1 ] . split ( " " ) ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    nums [ i ] = Integer . parseInt ( splits [ i ] ) ;
  }
  int max = Integer . MIN_VALUE ;
  HashMap < Integer , Integer > xCounts = new HashMap < > ( ) ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    xCounts . put ( nums [ i ] - 1 , xCounts . getOrDefault ( nums [ i ] - 1 , 0 ) + 1 ) ;
    max = Math . max ( max , xCounts . get ( nums [ i ] - 1 ) ) ;
    xCounts . put ( nums [ i ] , xCounts . getOrDefault ( nums [ i ] , 0 ) + 1 ) ;
    max = Math . max ( max , xCounts . get ( nums [ i ] ) ) ;
    xCounts . put ( nums [ i ] + 1 , xCounts . getOrDefault ( nums [ i ] + 1 , 0 ) + 1 ) ;
    max = Math . max ( max , xCounts . get ( nums [ i ] + 1 ) ) ;
  }
  return max ;
}

private static int solve ( String stdinString ) { String [ ] splits = stdinString . split ( " \n " ) ; int N = Integer . parseInt ( splits [ 0 ] ) ; int [ ] nums = new int [ N ] ; splits = splits [ 1 ] . split ( " ▁ " ) ; for ( int i = 0 ; i < N ; i ++ ) { nums [ i ] = Integer . parseInt ( splits [ i ] ) ; } int max = Integer . MIN_VALUE ; HashMap < Integer , Integer > xCounts = new HashMap < > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { xCounts . put ( nums [ i ] - 1 , xCounts . getOrDefault ( nums [ i ] - 1 , 0 ) + 1 ) ; max = Math . max ( max , xCounts . get ( nums [ i ] - 1 ) ) ; xCounts . put ( nums [ i ] , xCounts . getOrDefault ( nums [ i ] , 0 ) + 1 ) ; max = Math . max ( max , xCounts . get ( nums [ i ] ) ) ; xCounts . put ( nums [ i ] + 1 , xCounts . getOrDefault ( nums [ i ] + 1 , 0 ) + 1 ) ; max = Math . max ( max , xCounts . get ( nums [ i ] + 1 ) ) ; } return max ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (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 (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (array_access array: (identifier) index: (decimal_integer_literal)) name: (identifier) arguments: (argument_list (string_literal))))) (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 (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (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 (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) (decimal_integer_literal))) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (decimal_integer_literal))) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) (decimal_integer_literal))) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))))))))) (return_statement (identifier))))