Nov-22-2020, 05:12 PM
Hello fellow python programmers,
I have the following problem:
I have got k gifts and k people. Every gift is denoted by [1..k] and every person as well.
Every person has 3 wishes [x, y , z] which all correspond to one gift. Every person will get a gift and every gift is unique. How do I accomplish, that I achieve these goals:
1st Maximum of people should get their first wish
2nd Maximum of people should get their second wish --> Optimization after the first step which is more important
3rd Maximum of people should get their third wish, if their first and second wish wasn't fullfilled.
I've thought about a greedy algorithm, but I'm lost
I have the following problem:
I have got k gifts and k people. Every gift is denoted by [1..k] and every person as well.
Every person has 3 wishes [x, y , z] which all correspond to one gift. Every person will get a gift and every gift is unique. How do I accomplish, that I achieve these goals:
1st Maximum of people should get their first wish
2nd Maximum of people should get their second wish --> Optimization after the first step which is more important
3rd Maximum of people should get their third wish, if their first and second wish wasn't fullfilled.
I've thought about a greedy algorithm, but I'm lost