Given an array of positive integers, determine whether it can be partitioned into two subsets with equal sum. This is the canonical partition problem and a direct subset-sum reduction.
nums = array of positive integers
true if nums can be partitioned into two equal-sum subsets
Example 1:
Input:
nums = [1,5,11,5]
Output:
true
Explanation:
The array can be split into [1,5,5] and [11].
Example 2:
Input:
nums = [1,2,3,5]
Output:
false
Explanation:
The sum is odd, so equal partition is impossible.