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.
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.