DoorDash interview question

Leetcode style coding about med/hard level