private static String calc ( int [ ] candy ) {
  int xor = 0 ;
  int smallest = Integer . MAX_VALUE ;
  int sum = 0 ;
  for ( int c : candy ) {
    if ( smallest > c ) smallest = c ;
    xor ^= c ;
    sum += c ;
  }
  if ( xor != 0 ) return "NO" ;
  return "" + ( sum - smallest ) ;
}

private static String calc ( int [ ] candy ) { int xor = 0 ; int smallest = Integer . MAX_VALUE ; int sum = 0 ; for ( int c : candy ) { if ( smallest > c ) smallest = c ; xor ^= c ; sum += c ; } if ( xor != 0 ) return " NO " ; return " " + ( sum - smallest ) ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (string_literal))) (return_statement (binary_expression left: (string_literal) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))))