Go prefix sum then binary search
\nfunc answerQueries(nums []int, queries []int) []int {\n    res := make([]int, len(queries))\n    \n    sort.Ints(nums)\n    \n    for i := 1; i < len(nums); i
```\nfunc answerQueries(nums []int, queries []int) []int {\n    res := make([]int, len(queries))\n    \n    sort.Ints(nums)\n    \n    for i := 1; i < len(nums); i++ {\n        nums[i] += nums[i - 1]\n    }\n    \n    for i, query := range queries {\n        lo, hi := 0, len(nums)\n        \n        for lo < hi {\n            mid := lo + ((hi - lo) >> 1)\n            \n            if nums[mid] <= query {\n                lo = mid + 1\n            } else {\n                hi = mid\n            }\n        }\n        \n        res[i] = lo\n    }\n    \n    return res\n}\n```
['Go']