Question d’entretien chez Palantir Technologies

Just coding challenge, BFS/DFS stuff, pretty simple