DoorDash Interview Question

Two leetcode medium to hards.