Re: [閒聊] 每日leetcode

作者: DJYOMIYAHINA (通通打死)   2024-07-09 08:42:50
剩肥肥沒錢去餐廳吃飯了
乖乖出門坐一個小時車去當帕魯
:(
def averageWaitingTime(self, customers: List[List[int]]) -> float:
finish_t = 0
waiting_sum = 0
for c in customers:
finish_t = max(finish_t+c[1], c[0]+c[1])
waiting_sum += (finish_t-c[0])
return waiting_sum/len(customers)
作者: Sadolapapa (凜)   2024-07-09 08:48:00
別捲了
作者: rainkaras (rainkaras)   2024-07-09 08:59:00
用坐車時間刷題 大師

Links booklink

Contact Us: admin [ a t ] ucptt.com