Question d’entretien chez Amazon

some algoritmim to solve i n python