NeetCode #722LC-494Medium2-D Dynamic ProgrammingNC 150NC 250
← Back to All Problems

#722 · #494 · Target Sum(目标和)

📌 Problem Statement & Constraints

Given an integer array nums and an integer target, assign a + or - sign to every element so that the resulting expression equals target. Return the number of distinct sign assignments. Constraints: 1 <= nums.length <= 20, 0 <= nums[i] <= 1000, 0 <= sum(nums) <= 1000, -1000 <= target <= 1000.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!