Pergunta de entrevista da empresa DoorDash

Problem similar to Leetcode Walls and Gates