Subset Sum with n up to 40
Hard
Meet in the Middle
Print YES if some subset of the given numbers sums exactly to target, otherwise NO. n can be 40, which is too large for 2^n brute force.
Constraints
1 <= n <= 40 1 <= nums[i] <= 10^9
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.