public class Solution {

public int findTargetSumWays(int[] nums, int S) {

return proccess( nums, nums.length-1,S);

}

```
private int proccess(int[] nums,int pst,int s){
return pst>0?proccess(nums,pst-1,s+nums[pst])+proccess(nums,pst-1,s-nums[pst]):Math.abs(s)==Math.abs(nums[0])? (nums[0]==0?2:1):0;
}
```

}