Solution: Partition Equal Subset Sum
Let's solve the Partition Equal Subset Sum problem using the Dynamic Programming pattern.
Statement
Given a non-empty array of positive integers, determine if the array can be divided into two subsets so that the sum of both subsets is equal.
Constraints:
-
nums.Length
-
nums[i]
Solution
So far, you’ve probably brainstormed some approaches and have an idea of how to solve this problem. Let’s explore some of these approaches and figure out which one to follow based on considerations such as time ...
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.