Simple commented explanation || PQ || C++
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)$$ -->\nO(NLog(N))\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(N)\n# Code\n```\nclass Solution {\npublic:\n\n    \nstatic bool comp(vector<int>&a , vector<int>&b){\n    if(a[0]==b[0]) return a[1]<b[1];\n    return a[0]<b[0];\n}\nvector<int> maximumSumQueries(vector<int>& nums1, vector<int>& nums2, vector<vector<int>>& queries) {\n        int n = nums1.size();\n        // queries ko sort kr lete h for comparing easily\n        // and uske index ko v sath rakh lenge for not any confusion\n        vector<vector<int>> sq;   // sorted queries  // phle vector me daal rhe fir sort kr denge\n        for(int i=0;i<queries.size();i++){\n            sq.push_back({queries[i][0] , queries[i][1] , i});\n        }\n        sort(sq.begin(),sq.end(),comp);\n        priority_queue<vector<int>> pq,tempq;\n        for(int i=0;i<n;i++){\n            pq.push({nums1[i]+nums2[i] , nums1[i] , nums2[i]});\n        }\n        vector<int> ans(queries.size() , -1);\n        for(auto it : sq){\n            while(!pq.empty()){   \n                if(pq.top()[1] <it[0]){  // jo v element in nums1 chote h queries[i][0] se  then simply usko remove kr do\n                    pq.pop();\n                } \n                // if koi v element in nums2 chota h queries[i][1] se then usko v remove kr do for particular query isliye usko  ek jagah store v kr do\n                else if(pq.top()[2]<it[1]){\n                    tempq.push(pq.top());\n                    pq.pop();\n                }\n                else break;\n            }\n            // now here updating our answer with the help of index mapping in sq vector   // sorted queries\n            if(!pq.empty()){\n                ans[it[2]]=pq.top()[0];\n            }\n            // if done with  that query then usko fir se daal do pq me q ki vo kisi or k liye v use ho skta\n            while(!tempq.empty()){\n                pq.push(tempq.top());\n                tempq.pop();\n            }\n        }\n        \n    \n        return ans ;\n    }\n};\n```
['Sorting', 'Heap (Priority Queue)', 'C++']