static int StrictlyPositiveXor ( int [ ] A , int N ) {
  int allxor = 0 ;
  boolean checkallzero = true ;
  for ( int i = 0 ;
  i < N ;
  i += 1 ) {
    allxor ^= A [ i ] ;
    if ( A [ i ] > 0 ) checkallzero = false ;
  }
  if ( allxor != 0 ) return N ;
  if ( checkallzero ) return - 1 ;
  int l = N , r = - 1 ;
  for ( int i = 0 ;
  i < N ;
  i += 1 ) {
    if ( A [ i ] > 0 ) {
      l = i + 1 ;
      break ;
    }
  }
  for ( int i = N - 1 ;
  i >= 0 ;
  i -= 1 ) {
    if ( A [ i ] > 0 ) {
      r = i + 1 ;
      break ;
    }
  }
  return Math . max ( N - l , r - 1 ) ;
}

static int StrictlyPositiveXor ( int [ ] A , int N ) { int allxor = 0 ; boolean checkallzero = true ; for ( int i = 0 ; i < N ; i += 1 ) { allxor ^= A [ i ] ; if ( A [ i ] > 0 ) checkallzero = false ; } if ( allxor != 0 ) return N ; if ( checkallzero ) return - 1 ; int l = N , r = - 1 ; for ( int i = 0 ; i < N ; i += 1 ) { if ( A [ i ] > 0 ) { l = i + 1 ; break ; } } for ( int i = N - 1 ; i >= 0 ; i -= 1 ) { if ( A [ i ] > 0 ) { r = i + 1 ; break ; } } return Math . max ( N - l , r - 1 ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (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: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (false)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (identifier))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (return_statement (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier)) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_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: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (break_statement))))) (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: (decimal_integer_literal)) update: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (break_statement))))) (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)) (binary_expression left: (identifier) right: (decimal_integer_literal)))))))