LeetCode 494. Target Sum — 0/1 Knapsack Reframed
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:
+...
leetlog-by-chao.hashnode.dev3 min read