DoorDash interview question

Leetcode Medium question involving traffic