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.
Count the values in each length-k window, keep the x most frequent (larger value wins ties), and add their occurrences.