Problem 3318 · Easy

Find X-Sum of All K-Long Subarrays I

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