Prefix Sum + Binary Search
 # Intuition  \n\n\n\n\n\n# Complexity\n- Time complexity: O(qlog(n))\n\n\n- Space complexity: O(1)\n\n\n# Code\n\nclass Solution {\n    public int[] answerQuer
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n<!-- # Approach -->\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(qlog(n))$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[] answerQueries(int[] nums, int[] queries) {\n        Arrays.sort(nums);\n        for (int i = 1; i < nums.length; i++) {\n            nums[i] += nums[i - 1];\n        }\n        for (int i = 0; i < queries.length; i++) {\n            queries[i] = Math.abs(~Arrays.binarySearch(nums, queries[i]));\n        }\n        return queries;\n    }\n}\n```
['Binary Search', 'Prefix Sum', 'Java']