Question d’entretien chez Google

a memory and complexity coding problem