Completed GetAllPossibleSums function used for Problem 30