Uber Interview Question

Longest repeating sequence with replacement