Problem 3321 · Hard

Find X-Sum of All K-Long Subarrays II

Count the values in each length-k window, keep the x most frequent (larger value wins ties), and add their occurrences.

Open the interactive visualisation