Code Room
CodingHardcod-g245
Subject Bipartite matchingLevel Senior–Staff~40 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

You have n_left workers (0..n_left-1) and n_right tasks (0..n_right-1). Each edge [u, v] means worker u can do task v. Each worker does at most one task and each task is done by at most one worker. Return the maximum number of (worker, task) assignments possible. Constraints: 1 <= n_left, n_right <= 500.

Implement
max_bipartite_matching(n_left: int, n_right: int, edges: list[list[int]]) → int
Examples
in[2,2,[[0,0],[0,1],[1,0]]]out2
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.