Back to problems

Calculate Dasher Salary

Algorithm · DoorDash · Medium

Given a list of delivery records for a dasher, compute the total salary. Each record is a string array with three elements: orderId, timestamp (as a string), and status. The status can be "ACCEPTED", "CANCELED", or "DELIVERED". "ACCEPTED" indicates the order was picked up and the delivery timer starts. "DELIVERED" means the order was completed; the dasher earns pay equal to the time difference between the "DELIVERED" and "ACCEPTED" timestamps, multiplied by the salaryRate.…

Checking your access…