Payroll Distribution
Distribute payroll funds proportionally when insufficient, handling remainders fairly.
Hard
Time:
O(n log n)
Space:
O(n)
Example:
amount=30, {a:10,b:5,c:10,d:8} → {a:9,b:5,c:9,d:7}
Math
Proportional Allocation
Greedy
View Solution →