Pregunta de entrevista de Amazon

simple BFS approach implementation needed to be coded