LeetCode 494. Target Sum — 0/1 Knapsack Reframed
Dec 3, 2025 · 3 min read · This post solves LeetCode 494. Target Sum by converting it into a subset sum / 0-1 knapsack counting problem. Problem Summary You are given an array nums and a target.By placing '+' or '-' in front of each number, you create an expression such as: +...
Join discussion


