826. Most Profit Assigning Work
肥肥别的不懂
只懂得排序
def maxProfitAssignment(self, difficulty: List[int], profit: List[int],
worker: List[int]) -> int:
worker.sort()
difficulty, profit = zip(*sorted(zip(difficulty, profit)))
maximum_profit, idx, ans = 0, 0, 0
for d in worker:
while idx<len(difficulty) and d>=difficulty[idx]:
maximum_profit = max(maximum_profit, profit[idx])
idx += 1
ans += maximum_profit
return ans