Problem 2730 · Medium

Find the Longest Semi-Repetitive Substring

Keep a window with at most one equal adjacent pair by moving its start past the older pair.

Open the interactive visualisation