My solution:

```
class Solution {
public:
int findTargetSumWays(vector<int> const& nums, int s, int i = 0)
{
if(i == nums.size())
return s == 0;
return findTargetSumWays(nums, s-nums[i], i+1)
+ findTargetSumWays(nums, s+nums[i], i+1);
}
};
```