Meta Interview Question

Longest repeating substring with replacement