• 38.3%

https://leetcode.com/problems/partition-equal-subset-sum/?tab=Description

Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.

Note:

1. Each of the array element will not exceed 100.
2. The array size will not exceed 200.

https://discuss.leetcode.com/topic/62334/simple-c-4-line-solution-using-a-bitset

Simple C++ 4-line solution using a bitset
Note: as @zhoudayang2 pointed out, the question description has changed (max array size 100 ==> 200). I have modified my code below according to the new description, and also made it a bit easier to understand.

Time complexity O(n), size of the bitset is 1256 bytes

It’s possible to shorten the solution to 4 lines, by using std::accumulate(), but that doesn’t really make you type less or make it run faster though…

https://discuss.leetcode.com/topic/62285/concise-c-solution-summary-with-dfs-dp-bit

Concise C++ Solution summary with DFS, DP, BIT

DFS solution:

DFS can’t pass the OJ, as more test cases are added. So here comes a DP solution based on @Hermits solution

A very fast and cool Bit solution by @alvin-777 solution

My Simple C++ DP Code with Comments

#### python

https://discuss.leetcode.com/topic/62308/7-lines-59ms-recursive-python-solution

7 Lines 59ms Recursive Python Solution

Seek whether there’s a combination has the sum equal to half of total sum.

Simply return False if sum of the list is not even.

Target minus each element as Target for next recursion of the rest elements.

Base case:

Target < 0 (ignore)

Target == 0 (return True)

Recursive case:

Otherwise

https://discuss.leetcode.com/topic/64124/4-line-passed-python-solution

4 line passed python solution

#### java

33ms, , October 18, 2016

https://discuss.leetcode.com/topic/62312/java-solution-similar-to-backpack-problem-easy-to-understand