DoorDash interview question

Leetcode easy/medium