Leetcode 0416. Partition Equal Subset Sum

Posted on Sun 24 November 2024 in Leetcode • Tagged with knapsack-1-0

Question Link : https://leetcode.com/problems/partition-equal-subset-sum/

Difficulty: Medium

Premium: False

Question

Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false otherwise.   Example 1:

Input: nums = [1,5,11 …


Continue reading

Leetcode 0494. Target Sum

Posted on Sun 24 November 2024 in Leetcode • Tagged with backtracking, dp, knapsack-1-0

Question Link : https://leetcode.com/problems/target-sum/

Difficulty: Medium

Premium: False

Question

You are given an integer array nums and an integer target. You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers …


Continue reading