Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
We can see that the problem can be represented as a directed graph with an edge from each boy to the girl he invited.
We need to choose a set of edges such that no to source points in the graph (i.e., boys) have an edge with the same endpoint (i.e., the same girl).
The problem is maximum bipartite matching in the graph.