Question d’entretien chez Amazon

Solve a backtracking problem and TC.