Question d’entretien chez Amazon

Typical algorithm complexity questions. Not difficult.