Problem 3837 · Medium

Delayed Count of Equal Elements

Sweep from the right while a running tally holds only the values at least k plus one places ahead.

Open the interactive visualisation