Question d’entretien chez Google

String manipulation with less time complexity