Problem
You are given an integer array nums and an integer target. Put either a `+` or a `-` sign in front of every number, then add them all up. Return the number of different sign assignments that make the total equal target.
Example 1
- Input
- nums = [1, 1, 1, 1, 1], target = 3
- Output
- 5
- Why
- one of the five 1s gets a minus
Example 2
- Input
- nums = [1], target = 1
- Output
- 1
Example 3
- Input
- nums = [0, 0, 0], target = 0
- Output
- 8
- Why
- each 0 can be + or -
Constraints
1 <= nums.length <= 200 <= nums[i] <= 10000 <= sum(nums) <= 1000-1000 <= target <= 1000