CSES problem: boys and girls. Each boy lists girls he's willing to dance with. Find the maximum number of boy-girl pairs where each person dances at most once. This is maximum bipartite matching. Boys are one set, girls are the other.
Each preference is an edge. Find the maximum matching. Model it as a flow problem: source to boys (capacity ), boys to girls (capacity ), girls to sink (capacity ). Max flow is the answer.