JAVA EASY
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 
# 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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution \n{\n    public int[] answerQueries(int[] nums, int[] queries) \n    {\n        Arrays.sort(nums);\n        int n = nums.length;\n        int m = queries.length;\n        int answer[] = new int[m];\n        \n        for (int i = 0; i < m; ++i) \n        {\n            int count = 0;\n            int query = queries[i];\n            for (int num : nums) \n            {\n                if (query >= num) \n                {\n                    count++;\n                    query -= num;\n                }\n                else\n                    break;\n            }\n            answer[i] = count;\n        }\n        return answer;\n    }\n}\n```
['Java']