Verified interview challenge
Maintain a mutable priority queue
Keep priority queries correct when existing entries are updated or removed IDs are inserted again.
Unlock with Full AccessThe challenge
Process a sequence of priority updates and queries while maintaining one current record per ID. Updates replace earlier priorities, and repeated peeks must leave the queue unchanged. The larger workloads require efficient access to the best current entry, including deterministic handling of tied priorities.
What you'll practise
Current-entry correctness
Ensure old priorities cannot reappear after an update or removal.
Efficient ordering
Handle repeated best-entry queries without scanning the full active set.
# Your implementation goes here
# Run examples and inspect results
# Full starter code includedRun your code to see results.