✅ Python ✅ binary search ✅ clean solution
\n    def answerQueries(self, nums, queries):\n        """\n        :type nums: List[int]\n        :type queries: List[int]\n        :rtype: List[int]\n        
```\n    def answerQueries(self, nums, queries):\n        """\n        :type nums: List[int]\n        :type queries: List[int]\n        :rtype: List[int]\n        """\n        nums.sort()\n        for i in range(1, len(nums)):\n            nums[i] += nums[i - 1]\n        \n        res = []\n        for q in queries:\n            idx = bisect.bisect_right(nums, q)\n            res.append(idx)\n        return res\n```
['Sorting', 'Binary Tree', 'Python']