Pregunta de entrevista de Wish

Graph question that involved BFS