static void distSumRec ( int arr [ ] , int n , int sum , int currindex , HashSet < Integer > s ) {
  if ( currindex > n ) return ;
  if ( currindex == n ) {
    s . add ( sum ) ;
    return ;
  }
  distSumRec ( arr , n , sum + arr [ currindex ] , currindex + 1 , s ) ;
  distSumRec ( arr , n , sum , currindex + 1 , s ) ;
}

static void distSumRec ( int arr [ ] , int n , int sum , int currindex , HashSet < Integer > s ) { if ( currindex > n ) return ; if ( currindex == n ) { s . add ( sum ) ; return ; } distSumRec ( arr , n , sum + arr [ currindex ] , currindex + 1 , s ) ; distSumRec ( arr , n , sum , currindex + 1 , s ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (generic_type (type_identifier) (type_arguments (type_identifier))) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (return_statement)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (return_statement))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))))))