Question d’entretien chez DoorDash

BFS problem and a string operation problem