注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
求米 doordash 原题
Food delivery companies employ tens of thousands of delivery drivers who each submit hundreds of deliveries per week.
Delivery details are automatically sent to the system immediately after the delivery.
Delivery drivers have different hourly payment rates, depending on their performance.
Drivers can take on, and be paid for, multiple deliveries simultaneously.
If a driver is paid $10.00 per hour, and a delivery takes 1 hour and 30 minutes, the driver is paid $15.00 for that deliveryvers.
Add the following functions:- pay_up_to(pay_time[integer, Unix time from epoch])
复制代码- Pay all drivers for recorded deliveries which ended up to and including the given time
- Return the total, aggregated cost of all drivers' deliveries which have not been paid
The solution does not need to be thread-safe or handle concurrency. |