I have a website where users submit questions (zero, one or multiple per day), vote on them and answer one question per day (more details here). A user can see the question only once either by submitting, voting or answering it.
I have a pool of questions that players have already seen. I need to remove 30 questions from the pool each month. I need to pick questions to remove in such way that I maximize the number of available questions left in the pool for player with least available questions.
Example with pool of 5 questions (and need to remove 3):
- player A has seen questions 1, 3 and 5
- player B has seen questions 1 and 4
- player C has seen questions 2 and 4
I though about removing the questions that top player has seen, but the position would change. Following the above example, player A has only got 2 questions left to play (2 and 4). However, if I remove 1, 3 and 5, the situation would be:
- player A can play questions 2 and 4
- player B can play question 2
- player C cannot play anything because 1,3,5 are removed and he has already seen 2 and 4.
The score for this solution is zero, i.e. the player with least amount of available questions has zero available questions to play.
In this case it would be better to remove 1, 3 and 4, giving:
- player A can play question 2
- player B can play questions 2 and 5
- player C can play question 5
The score for this solution is one, because the two players with least amount of available questions to play have one available question.
If the data size was small, I would be able to brute-force the solution. However, I have hundreds of players and questions, so I'm looking for some algorithm to solve this.