Live Batches
Masterclasses
Menu
Free Courses
Account
Login / Sign Up
Problem Submissions Solution

Target Sum Ways

Difficulty: Hard

Acceptance: 64.00%

Points: 40.00

The Target Sum Ways problem requires finding the number of different ways to assign either a '+' or '-' sign to each element in a given integer array such that the resulting expression equals a given target value. Every element must be used exactly once, and the order of elements cannot be changed. The task is to return the total number of possible ways to reach the target.

Topics

Companies

Articles

Examples:

N/A

Constraints:
  • 1 = nums.length = 20
  • 0 = nums[i] = 1000
  • -1000 = target = 1000
Companies:
Amazon Microsoft Apple Samsung Visa + 6 more
Topics:
Recursion
Locked Content
Access Restricted: Please Login to access the code editor and test cases.