@1337c0d3r I am not sure whether this has been fixed. My backtracking or DFS solution is currently 3 ms, fastest..... I have one optimization over the previous DFS solution, which is sorting the numbers and one of the two sets has to contain the largest number.

class Solution {
public:
bool canPartition(vector<int>& nums) {
int sum = 0;
for (int i:nums) sum += i;
if (sum&1) return false;
sum /= 2;
sort(nums.rbegin(), nums.rend());
return helper(nums, 1, nums[0], sum);
}
private:
bool helper(vector<int>& nums, int cur, int tot, int tar) {
if (cur == nums.size()) return tot == tar;
for (int i = cur; i < nums.size(); i++) {
if (tot+nums[i] <= tar && helper(nums, i+1, tot+nums[i], tar))
return true;
}
return tot == tar;
}
};