Design a Priority Buffer

Design a capacity-bounded priority buffer PriorityBuffer(capacity). Each message has an id, a priority (H high / L low) and a size.

  • push(id, priority, size): add the message. If the tot...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: