Problem 2524 · Medium

Maximum Frequency Score of a Subarray

Slide a window of length k, keep each value’s power term up to date as values enter and leave, and keep the largest reduced score.

Open the interactive visualisation