I am trying to solve this math problem in python, and I'm not sure what it is called:
- The answer X is always 100
- Given a list of 5 integers, their sum would equal X
- Each integer has to be between 1 and 25
- The integers can appear one or more times in the list
I want to find all the possible unique lists of 5 integers that match.
These would match:
- 20,20,20,20,20
- 25,25,25,20,5
- 10,25,19,21,25
along with many more.
I looked at itertools.permutations, but I don't think that handles duplicate integers in the list. I'm thinking there must be a standard math algorithm for this, but my search queries must be poor.
Only other thing to mention is if it matters that the list size could change from 10 integers to some other length (6, 24, etc).