← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given a chronologically ordered list of order events for a single Dasher on a given day. Each event is a tuple (timestamp, order_id, status) where status is one of {"ACCEPTED", "FULFILLED", "CANCELLED"}. A delivery is considered active from the moment it is ACCEPTED until the first of either FULFILLED or CANCELED occurs for that order_id. While at least one delivery is active the Dasher is on active time and accrues pay. The pay rules are: base rate = $0.30 per active minute; multi-order bonus = (number of simultaneously active deliveries) × base rate. In other words, every minute the Dasher earns $0.30 for each active delivery. Write a function that returns the total dollar amount the Dasher should be paid for the day.