✅C++ || ✅Simple || ✅Easy to Understand
\nclass Solution {\npublic:\n    vector<int> answerQueries(vector<int>& nums, vector<int>& queries) \n    {\n         vector<int>ans;\n         sort(nums.begin(
```\nclass Solution {\npublic:\n    vector<int> answerQueries(vector<int>& nums, vector<int>& queries) \n    {\n         vector<int>ans;\n         sort(nums.begin(),nums.end());\n         for(int i=0;i<queries.size();i++)\n         {\n            int limited_sum = queries[i];\n\n            int count=0;\n            int sum=0;\n\n            for(int j=0;j<nums.size();j++)\n            {\n                sum = sum + nums[j];\n                if(sum > limited_sum)\n                {\n                    break;\n                }\n                count++;\n            }\n\n            ans.push_back(count);\n         }\n         return ans;\n    }\n};\n```
['C', 'C++']