Skip to main content
Target Sum | AlgoCracked
AlgoCracked
ProblemsTarget Sum
Medium47.0% acceptance
Dynamic ProgrammingArrayBacktrackingDfs

Target Sum

Given an array of non-negative integers nums and an integer target , put a + or - in front of each number and concatenate them into an expression. Return the number of assignments whose expression evaluates to target . Input format Input is [nums, target] , e.g. [[1,1,1,1,1],3] .

Loading workspace…