Partition Equal Subset Sum

Given an integer array nums, determine if you can partition it into two subsets such that the sum of the elements in both subsets is equal. Return true if such a partition is possible, otherwise return false.

Constraints

  • 1 <= nums.length <= 200
  • 1 <= nums[i] <= 100
Saving… · 2 lines
class Solution:
def partitionEqualSubsetSum(self, nums: List[int]) -> bool:
Console

Click Run to execute sample tests.