Easiest Solution beats 100 percent
Intuition\n Describe your first thoughts on how to solve this problem. \nWe basically create a function to solve the x sum with the given conditions and we use 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nWe basically create a function to solve the x sum with the given conditions and we use the x sum function for the sub array\n# Approach\n<!-- Describe your approach to solving the problem. -->\nFirst we create a dictionary for the mapping to calculate the frequency and then we take the frequecy and the element as pairs and put in list this inner list is reversed such that the first index will be the frequency and second element will be the term itself. \nNext we sort and reverse. Now we have the final list with x first frequent terms.\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n*k)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\n# Code\n```python []\nclass Solution(object):\n    def findXSum(self, nums, k, x):\n        """\n        :type nums: List[int]\n        :type k: int\n        :type x: int\n        :rtype: List[int]\n        """\n        \n        def x_sum(arr,x):\n            if (len(list(set(arr))) < x):\n                return arr\n            d = {}\n            for i in arr:\n                d[i] = arr.count(i)\n            res = []\n            for i in d.keys():\n                res.append([d[i],i])\n            res.sort()\n            res.reverse()\n            f_res = []\n            for i in range(x):\n                for j in range(res[i][0]):\n                    f_res.append(res[i][1])\n            return f_res\n        n = len(nums)\n        des = []\n        for i in range(n-k+1):\n            des.append(sum(x_sum(nums[i:i+k],x)))\n        return des\n\n            \n```
['Python']