Question d’entretien chez Amazon

simple BFS approach implementation needed to be coded