Ezvor

1820. Maximum Number of Accepted Invitations

MediumArray Preparing judge… LeetCode
ArrayDepth-First SearchGraph TheoryMatrixMaximum FlowMaximum MatchingBipartite GraphEdmonds–Karp AlgorithmMPM AlgorithmPush-Relabel AlgorithmMatching (Graph)Flow NetworkDinic's Algorithm

Hints

Hint 1
We can see that the problem can be represented as a directed graph with an edge from each boy to the girl he invited.
Hint 2
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).
Hint 3
The problem is maximum bipartite matching in the graph.