Code RoomAssignment problem minimum cost
HardPrep Room Coding #96

Assignment problem minimum cost

CodingAlgorithms & data structuresSenior–Staff~30 min

There are n people and n tasks. cost[i][j] is the cost of assigning person i to task j. Each person must be assigned exactly one task and each task to exactly one person. Return the minimum total assignment cost. Here 1 <= n <= 14 and all costs are non-negative integers.

Implement
min_assignment_cost(cost: list[list[int]]) → int
Examples
in[[[9,2,7,8],[6,4,3,7],[5,8,1,8],[7,6,9,4]]]out13
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.

0:00 of about 30 min
InputExpectedGot
[[[9,2,7,8],[6,4,3,7],[5,8,1,8],[7,6,9,4]]]13not run yetsample