C++ two priority queue (EASY😈)
\nclass Solution {\npublic:\n    int mod=1e9+7;\n    int getNumberOfBacklogOrders(vector<vector<int>>& nums) {\n        priority_queue<pair<int,long long int>>b
```\nclass Solution {\npublic:\n    int mod=1e9+7;\n    int getNumberOfBacklogOrders(vector<vector<int>>& nums) {\n        priority_queue<pair<int,long long int>>buy;\n        priority_queue<pair<int,long long int>,vector<pair<int,long long int>>,greater<pair<int,long long int>>>sell;\n        int maxi1=0,maxi2=0;\n        \n        \n        for(int i=0;i<nums.size();i++){\n            if(nums[i][2]==0){//buy\n                bool b=false;\n                \n                while(!sell.empty() and sell.top().first<=nums[i][0] and nums[i][1]>0){\n                    pair<int,long long int>p=sell.top();\n                    sell.pop();\n                    if(p.second>nums[i][1]){\n                        b=true;\n                        sell.push({p.first,p.second-nums[i][1]});\n                            break;\n                    }\n                    nums[i][1]=abs(p.second - nums[i][1]);\n                }\n                if(b){continue;}\n                \n                if(nums[i][1]>0 ){\n                    maxi1=nums[i][1];\n                    buy.push({nums[i][0],nums[i][1]});\n                }\n            }\n            else{//sell\n                bool b=false;\n                \n                while(!buy.empty() and buy.top().first>=nums[i][0] and nums[i][1]>0){\n                    pair<int,long long int>p=buy.top();\n                    buy.pop();\n                    if(p.second>nums[i][1]){\n                        b=true;\n                        buy.push({p.first,p.second-nums[i][1]});\n                            break;\n                    }\n                    nums[i][1]=abs(p.second - nums[i][1]);\n                }\n                if(b){continue;}\n                \n                if(nums[i][1]>0 ){\n                    maxi2=nums[i][1];\n                    sell.push({nums[i][0],nums[i][1]});\n                }\n                \n            }\n        }\n        \n        int cnt=0;\n        while(!sell.empty()){\n            cnt=(cnt+((sell.top().second % mod)))%mod;\n            sell.pop();\n        }\n        while(!buy.empty()){\n            cnt=(cnt+((buy.top().second % mod)))%mod;\n            buy.pop();\n        }\n        return cnt;\n        \n    }\n};\n```
['C', 'Heap (Priority Queue)', 'C++']