This question evaluates competencies in bipartite matching and combinatorial optimization, along with practical data-structure design for scalable tag-based assignment and priority-aware selection.
You are building a simplified “Q&A matching” feature.
You have:
people
:
N
people, where person
i
has a set of expertise tags
P[i]
.
questions
:
M
questions, where question
j
has a set of tags
Q[j]
and an integer priority
prio[j]
(larger means more important).
A person i can be assigned to answer a question j if they share at least one tag:
Each person can answer at most one question, and each question can be answered by at most one person.
Compute an assignment of people to questions that:
Return:
tag -> list of people/questions
).