Question d’entretien chez Google

An algorithm question about string.