public static boolean dfs ( int index , int sum ) {
  if ( index == 3 && sum == 7 ) {
    return true ;
  }
  else if ( index <= 2 ) {
    results [ index ] = "+" ;
    if ( dfs ( index + 1 , sum + input [ index + 1 ] ) ) {
      return true ;
    }
    results [ index ] = "-" ;
    if ( dfs ( index + 1 , sum - input [ index + 1 ] ) ) {
      return true ;
    }
  }
  return false ;
}

public static boolean dfs ( int index , int sum ) { if ( index == 3 && sum == 7 ) { return true ; } else if ( index <= 2 ) { results [ index ] = " + " ; if ( dfs ( index + 1 , sum + input [ index + 1 ] ) ) { return true ; } results [ index ] = " - " ; if ( dfs ( index + 1 , sum - input [ index + 1 ] ) ) { return true ; } } return false ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (return_statement (true))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (string_literal))) (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))) consequence: (block (return_statement (true)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (string_literal))) (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))) consequence: (block (return_statement (true))))))) (return_statement (false))))