------
## 最终结论
```python
def findTargetSumWays(nums, S):
    def dfs(index, current_sum):
        if index == len(nums):
            return 1 if current_sum == S else 0
        return dfs(index + 1, current_sum + nums[index]) + dfs(index + 1, current_sum - nums[index])
    
    return dfs(0, 0)
```