Thursday, November 18, 2010

Subset Sums

Find all the subsets of a set of non-negative integerswhere the largest number is the sum of the remaining numbers,and return a count of the number of them. For instance, for the set { 1, 2, 3, 4, 6 }the subsets are1+2=3,1+3=4, 2+4=6, and1+2+3=6, so the result is 4 subsets. Apply your program to the set{ 3, 4, 9, 14, 15, 19, 28, 37, 47, 50, 54, 56, 59, 61, 70, 73, 78, 81, 92, 95, 97, 99 }.