easy solution
Intuitionlots of requirements for this oneApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
lots of requirements for this one

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def findXSum(self, nums: List[int], k: int, x: int) -> List[int]:
        res = []
        windowlen = k
        for i in range(len(nums) - windowlen + 1):
            subarr = nums[i: i + windowlen]
            print(subarr)
            d = defaultdict(int)
            for s in subarr:
                d[s] += 1
            d = sorted(d.items(), key=lambda x: (x[1], x[0]), reverse=True)
            print(d)
            now = 0
            cur = d[:x]
            for c in cur:
                now += (c[0] * c[1])
            res.append(now)
        return res
            

        

```
['Python3']