DoorDash Interview Question

Two Lc medium on leetcode