Aug-30-2017, 09:18 PM
General idea:
Number are 1 to 6
Each Person chooses 5 number.
Seniority is 1 the oldest & 5 the newest
If number repeat after 3 times, select next available from the chosen numbers
Person 1 chose 1,2,3,4,5
Person 2 chose 1,2,3,4,5
Person 3 chose 1,2,3,4,5
Person 4 chose 1,2,3,4,5
Person 5 chose 2,3,4,5,6
So basicly the list would be something like this right ? :
p1 = 1,2,3,4,5
p2 = 1,2,3,4,5
p3 = 1,2,3,4,5
p4 = 1,2,3,4,5
p5 = 2,3,4,5,6
I would like to have the final result filtered as such:
P1 = 1,2
P2 = 1,2
P3 = 1,2
P4 = 3,4
P5 = 3,4
I've read that "itertools" can be used to achieve such complex algorithm, but i need some help, anyone can give me some pointers?
Number are 1 to 6
Each Person chooses 5 number.
Seniority is 1 the oldest & 5 the newest
If number repeat after 3 times, select next available from the chosen numbers
Person 1 chose 1,2,3,4,5
Person 2 chose 1,2,3,4,5
Person 3 chose 1,2,3,4,5
Person 4 chose 1,2,3,4,5
Person 5 chose 2,3,4,5,6
So basicly the list would be something like this right ? :
p1 = 1,2,3,4,5
p2 = 1,2,3,4,5
p3 = 1,2,3,4,5
p4 = 1,2,3,4,5
p5 = 2,3,4,5,6
I would like to have the final result filtered as such:
P1 = 1,2
P2 = 1,2
P3 = 1,2
P4 = 3,4
P5 = 3,4
I've read that "itertools" can be used to achieve such complex algorithm, but i need some help, anyone can give me some pointers?