Minimum cost fulfillment
You run a fulfillment network. supply[i] units sit at warehouse i; demand[j] units are needed at store j; shipping one unit from warehouse i to store j costs cost[i][j]. Total supply equals total demand. Any warehouse can ship to any store. Return the minimum total shipping cost to satisfy all demand. Constraints: 1 <= len(supply), len(demand) <= 50; 0 <= supply[i], demand[j] <= 1000; 0 <= cost[i][j] <= 1000.
Implement
min_transport_cost(supply: list[int], demand: list[int], cost: list[list[int]]) → intExamples
in
[[3,4],[2,5],[[2,1],[3,2]]]out13What 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
[[3,4],[2,5],[[2,1],[3,2]]]13not run yetsample