Question d’entretien chez Amazon

build an adjacency list from the given input.