Partition Problem: All provided solutions are wrong

All provided solutions fail a simple test


Fixed by removing the cryptic part of the code where the sum gets divided by two.

Can someone explain why?

Hi, I think the question is to divide the complete array into 2 parts using all the elements. lets say if we are considering your test case. the possible subsets pairs will be {{2}, {5, 5, 10}}, {{2, 5}, {5, 10}}, {{2, 5, 5}, {10}}… so on. None of the pairs meet the required criteria of equal sum. that’s why the solutions returned false.

I think the problem statement should be reframed a bit for easier understanding.