Pergunta de entrevista da empresa Amazon

simple BFS approach implementation needed to be coded