
SpongeBob is hungry while waiting bus that can take him leave this weird place. However, he doesn't have that much money to buy food from the vending machine since he needs to use it for taking the bus. Now you are the vending machine that sells kandy to SpongeBob. You always prioritizes selling the cheapest item currently available in your storage so SpongeBob won't be broken. As a machine, you have two operations:
store <price>: Add an item with a given price (integer) into the vending machine.
sell: Sell the item with the lowest price currently in the machine. If the machine is empty, ignore this command.
Please implement the functions in the code, so SpongeBob can receive kandy from you.
Constraints
Hint: For the more efficient way to sell the cheapest kandy, you may refer to this link:
https://www.geeksforgeeks.org/dsa/introduction-to-min-heap-data-structure/
Also please note that you CANNOT use STL to solve this problem.
A sequence of commands (store <num> or sell).
A single line containing two integers separated by a space:
The total number of items sold.
The total revenue with '\n'.