Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1801. Number of Orders in the Backlog
Simulate batched buy/sell order matching where each buy matches with the lowest-price sell (and each sell with the highest-price buy), allowing partial fills until no matchable prices remain. Use a min-heap for sells and a max-heap for buys to efficiently process amounts and return the total backlog size modulo 1e9+7.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.