I have a large array of data, usually about 500 positive integer values (from 1 to 1 000 000).
I need to find which elements give a sum of X. Order doesn't matter. Number of elements in subset which solves the problem is known and usually about 1/5 N. Can it help in any way to create an algorithm, which will find all possible solutions significantly faster? Would it even matter with so many elements in array?