easy approach!! Just a bit of priority queue knowledge and its really easy
Intuition\n Describe your first thoughts on how to solve this problem. \nI am a stock market guy. So appeared easy for me to understand. Just try to understand 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nI am a stock market guy. So appeared easy for me to understand. Just try to understand the problem statement and it will be a matter of minutes to solve this.\n# Approach\n<!-- Describe your approach to solving the problem. -->\nyou can understand the approach by seeing code itself as it is commented and try to take a few of test cases.\n# Complexity\n- Time complexity: O(nlogn) because we are traversing orders once that gives O(n) and Insertion and Deletion happens at most once each for each order. So that takes logarithmic time.\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n\n# Code\nclass Solution {\npublic:\n    int getNumberOfBacklogOrders(vector<vector<int>>& orders) {\n        priority_queue<pair<int, int>> buy; // Max-Heap for buy orders\n        priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> sell; // Min-Heap for sell orders\n        \n        for (auto& order : orders) {\n            int price = order[0];\n            int quantity = order[1];\n            int type = order[2];\n            \n            if (type == 0) {\n                // This is a buy order\n                while (!sell.empty() && sell.top().first <= price && quantity > 0) {\n                    auto [sellPrice, sellQuantity] = sell.top();\n                    sell.pop();\n                    if (sellQuantity > quantity) {\n                        sellQuantity -= quantity;\n                        quantity = 0;\n                        sell.push({sellPrice, sellQuantity});\n                    } else {\n                        quantity -= sellQuantity;\n                    }\n                }\n                if (quantity > 0) {\n                    buy.push({price, quantity});\n                }\n            } else {\n                // This is a sell order\n                while (!buy.empty() && buy.top().first >= price && quantity > 0) {\n                    auto [buyPrice, buyQuantity] = buy.top();\n                    buy.pop();\n                    if (buyQuantity > quantity) {\n                        buyQuantity -= quantity;\n                        quantity = 0;\n                        buy.push({buyPrice, buyQuantity});\n                    } else {\n                        quantity -= buyQuantity;\n                    }\n                }\n                if (quantity > 0) {\n                    sell.push({price, quantity});\n                }\n            }\n        }\n        \n        long long backlog = 0;\n        long long modulo = 1e9 + 7;\n        \n        while (!buy.empty()) {\n            backlog = (backlog + buy.top().second) % modulo;\n            buy.pop();\n        }\n        \n        while (!sell.empty()) {\n            backlog = (backlog + sell.top().second) % modulo;\n            sell.pop();\n        }\n        \n        return backlog;\n    }\n};
['C++']