Meta interview question

Longest repeating substring with replacement