Optimizing subset sum implementation
问题 I'm working on a solution to a variant of the subset sum problem, using the below code. The problem entails generating subsets of 11 ints from a larger set (superset) and check if it matches a specific value (endsum). #include <stdio.h> #include <stdlib.h> #include <assert.h> int endsum = 0, supersetsize = 0, done = 0; int superset[] = {1,30,10,7,11,27,3,5,6,50,45,32,25,67,13,37,19,52,18,9}; int combo = 0; int searchForPlayerInArray(int arr[], int player) { for (int i=0; i<11; i++) { if (arr