C++ ||Begineer Friendly|| Easy-Understanding|| Prefix Sum || Video solution
Intuition\n Describe your first thoughts on how to solve this problem. \nC++ Clear Explaination ,Please support if you find it usefull. Can give me feedback in 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n**C++ Clear Explaination ,Please support if you find it usefull. Can give me feedback in comment for improvement.,will be very thankfull.**\nhttps://www.youtube.com/watch?v=xDcD3yPxooY/\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n- O(n)+mO(log n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n- O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n vector<int> answerQueries(vector<int>& nums, vector<int>& queries)\n    {\n        int n = nums.size();\n        int m = queries.size();\n\n        sort(nums.begin(),nums.end());\n\n        vector<int>prefixsum(n);\n        int temp=0;\n        for(int i =0;i<n;i++)\n        {\n           temp +=nums[i];\n           prefixsum[i] = temp;\n        }\n        vector<int>ans;\n        for(int i=0;i<m;i++)\n        {\n            int query = queries[i];\n             ans.push_back(upper_bound(prefixsum.begin(),prefixsum.end(),query)-prefixsum.begin());\n        }\n\n        return ans;\n    }\n};\n```
['Array', 'Binary Search', 'Greedy', 'Prefix Sum', 'C++']