Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calcSixNumberCombinations(numberSet, sumGoal):
- s = sum(partial)
- if s == sumGoal:
- print "sum(%s)=%s" % (partial, target)
- if s >= sumGoal:
- return
- for i in range(len(numbers)):
- n = numberSet[i]
- remainingNumbers = numberSet[i+1:]
- calcSixNumberCombinations(remainingNumbers, sumGoal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement