Problem 3960 · Medium

Frequency Balance Subarray

Find the longest window that either repeats one value or whose distinct values come in exactly two frequency levels, one double the other.

Open the interactive visualisation