Dashboard
LC #416

Partition Equal Subset Sum

Pattern · ?AmazonGoogleMeta

Problem

Determine if an array can be partitioned into two subsets with equal sum.

Constraints

  • 1 ≤ n ≤ 200
  • 1 ≤ nums[i] ≤ 100

Example

Input
nums = [1, 5, 11, 5]
Output
true
Why
Sum=22, target=11. Subset [1,5,5]=11 and [11]=11

Spot the pattern

Which pattern cracks it?

Hints

One at a time
Solve on LeetCode ↗