Easy python solution (Sorting + PrefixSum + Binary Search)
Code\n\nclass Solution:\n    def answerQueries(self, nums: List[int], queries: List[int]) -> List[int]:\n        def find(ele,ps):\n            idx = -1\n      
# Code\n```\nclass Solution:\n    def answerQueries(self, nums: List[int], queries: List[int]) -> List[int]:\n        def find(ele,ps):\n            idx = -1\n            l=0\n            h = len(ps)-1\n            while l<=h:\n                mid = (l+h)//2\n                if ps[mid]<=ele:\n                    idx = mid\n                    l = mid+1\n                else:\n                    h = mid-1\n                \n            return idx\n\n        nums.sort()\n        ps = [nums[0]]\n        for i in range(1,len(nums)):\n            ps.append(ps[-1]+nums[i])\n        #print(ps)\n        ans = [0]*len(queries)\n        for i in range(len(queries)):\n            idx = find(queries[i],ps)\n            ans[i] = idx+1\n        return ans\n    \n\n```
['Binary Search', 'Sorting', 'Prefix Sum', 'Python3']