Pregunta de entrevista de Uber

Longest repeating sequence with replacement