Bipartite matching maximum
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]]) → intExamples
in
[2,2,[[0,0],[0,1],[1,0]]]out2What 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.
0:00 of about 40 min
solution.py
InputExpectedGot
[2,2,[[0,0],[0,1],[1,0]]]2not run yetsample