Pregunta de entrevista de Citadel Securities

Implement a data structure that can efficiently handle operations X and Y on strings.