Question d’entretien chez Goldman Sachs

Q: string manipulation optimization leet code medium question.