105: Partition equal subset sum

Given an array of positive integers, check if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal

 

Example 1

Input:   [3, 4, 2, 3]

Output:  true

Explanation: [3, 3] and [4, 2]

Example 2

Input:   [3, 4, 1, 3]

Output:  false
Difficulty:Medium
Topic:Dynamic programming
Problem #:105