✅ Python Solution | Easy Approach
\nclass Solution:\n    def answerQueries(self, nums: List[int], queries: List[int]) -> List[int]:\n        answer = [0] * len(queries)\n        for id, query in
```\nclass Solution:\n    def answerQueries(self, nums: List[int], queries: List[int]) -> List[int]:\n        answer = [0] * len(queries)\n        for id, query in enumerate(queries):\n            spec_sum = 0\n            for i, number in enumerate(sorted(nums)):\n                spec_sum += number\n\n                if spec_sum <= query:\n                    answer[id] += 1\n                else:\n                    break\n\n        return answer\n```
['Python', 'Python3']