Assign + or - to each number in an array to make the sum equal to target. Count the number of ways.
Use a hashmap DP: dp[sum] = number of ways to reach that sum. Process each number, updating possible sums.
💡 Pro tip: Understand this problem deeply — don't just memorize the code. Try explaining the approach out loud as if teaching a friend. If you can explain it simply, you truly understand it!
findTargetSumWays([1,1,1,1,1], 3)
5