Tap here to switch tabs
Problem
Submissions

Problem: Target Sum

med
30 min
Try to solve the Target Sum problem.

Statement

Given an integer array nums and an integer target, assign either the symbol + or the symbol - to each element in nums, then evaluate the resulting expression by summing all signed values. Return the number of different symbol assignments whose total equals target.

Constraints:

  • 11 \leq nums.length 20\leq 20

  • 00 \leq nums[i] 1000\leq 1000

  • 00 \leq \sum(nums[i]) 1000\leq 1000

  • 1000-1000 \leq target 1000\leq 1000

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths
Tap here to switch tabs
Problem
Submissions

Problem: Target Sum

med
30 min
Try to solve the Target Sum problem.

Statement

Given an integer array nums and an integer target, assign either the symbol + or the symbol - to each element in nums, then evaluate the resulting expression by summing all signed values. Return the number of different symbol assignments whose total equals target.

Constraints:

  • 11 \leq nums.length 20\leq 20

  • 00 \leq nums[i] 1000\leq 1000

  • 00 \leq \sum(nums[i]) 1000\leq 1000

  • 1000-1000 \leq target 1000\leq 1000

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths