Algorithm · DoorDash · Medium
Create a function that determines a Dasher's total earnings from an operations log. Each record contains a timestamp followed by an operation, with timestamps written as YYYY-MM-DD HH:MM:SS. The possible operations are START_WORK, END_WORK, and TIP. Compute the time spent working from START_WORK through END_WORK, pay that time at an hourly rate of $20, and then include every tip amount. The log entries are already ordered by time. Return the Dasher's final payment amount.…
Checking your access…