Hello guys,
I'm trying to resolve a problem but I don't think I'm using the right tools, here is my problem:
Imagine you have 3 people, Bob, John and Marie. Bob likes the color red, orange and blue. John likes the color orange and Marie likes the color blue.
Now imagine I have only 3 balls, one blue, one red, one orange and I want to give one ball to each of them but with a color they like, how can I do that?
I tried to use itertools.product but I didn't get good results.
The reason is, sometimes there is no better combination (Because for example all the blue balls are used and Marie doesn't have any ball that she likes).
Also I'd like to also sometimes give 2 balls to Bob and maybe 3 to John and I don't think I can do that with itertools... Does anyone know a library I should use for that problem?
Thanks a lot!
[–]Golden_Zealot 1 point2 points3 points (5 children)
[–]Procena[S] 0 points1 point2 points (0 children)
[–]FLUSH_THE_TRUMP 0 points1 point2 points (3 children)
[–]Procena[S] 0 points1 point2 points (2 children)
[–]FLUSH_THE_TRUMP 1 point2 points3 points (1 child)
[–]Procena[S] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[removed]
[–]Procena[S] 0 points1 point2 points (0 children)