Pregunta de entrevista de Meta

Longest repeating substring with replacement