Sliding Window and Hash Table
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nSliding Window and Hash_table\n\n# Complexity\n- Time complexity:\n Add y
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nSliding Window and Hash_table\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nNot the Best OK Solution - O(N\u2217K\u2217Log(K)+N\u2217K)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(N)\n\n# Code\n```python3 []\nclass Solution:\n    def findXSum(self, nums: List[int], k: int, x: int) -> List[int]:\n        \n        result = []\n\n        for i in range(len(nums)-k+1):\n\n            curr_elem = nums[i:i+k]\n            sorted_dict = sorted(Counter(curr_elem).items(),key=lambda x:(-x[1],-x[0]))[:x]\n            result.append(sum([v[0]*v[1] for v in sorted_dict]))\n        \n        return result\n\n\n\n```
['Sliding Window', 'Python3']