Day 329 Problem 2 Solved
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Code\npython3 []\nc
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Code\n```python3 []\nclass Solution:\n    def findXSum(self, nums: List[int], k: int, x: int) -> List[int]:\n        res = []\n        for i in range(len(nums) - k + 1):\n            c = [[count, val] for val, count in Counter(nums[i : i + k]).items()]\n            c = heapq.nlargest(x, c)\n            res.append(sum(val * count for count, val in c))\n        return res\n\n```
['Python3']