Problem 3641 · Medium

Longest Semi-Repeating Subarray

Grow a window to the right and shrink it from the left whenever more than k values repeat inside it.

Open the interactive visualisation