Question d’entretien chez Amazon

BFS search tree algorithm with conditions