static boolean firstWin ( int N , int [ ] a ) {
  Arrays . sort ( a ) ;
  for ( int i = 0 ;
  i < N ;
  i ++ ) {
    if ( N - i <= a [ i ] ) {
      boolean win = ( a [ i ] - ( N - i ) ) % 2 == 1 ;
      int sameSize = 0 ;
      for ( int j = i - 1 ;
      j >= 0 && a [ j ] == N - i ;
      j -- ) sameSize ++ ;
      win |= sameSize % 2 == 1 ;
      return win ;
    }
  }
  return false ;
}

static boolean firstWin ( int N , int [ ] a ) { Arrays . sort ( a ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( N - i <= a [ i ] ) { boolean win = ( a [ i ] - ( N - i ) ) % 2 == 1 ; int sameSize = 0 ; for ( int j = i - 1 ; j >= 0 && a [ j ] == N - i ; j -- ) sameSize ++ ; win |= sameSize % 2 == 1 ; return win ; } } return false ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (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 (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (array_access array: (identifier) index: (identifier)))) consequence: (block (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) right: (decimal_integer_literal)) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (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: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (identifier) right: (identifier)))) update: (update_expression (identifier)) body: (expression_statement (update_expression (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)))) (return_statement (identifier)))))) (return_statement (false))))