Skip to content

Day 358 #707

@vaskoz

Description

@vaskoz

Good morning! Here's your coding interview problem for today.

This problem was asked by Dropbox.

Create a data structure that performs all the following operations in O(1) time:

  • plus: Add a key with value 1. If the key already exists, increment its value by one.
  • minus: Decrement the value of a key. If the key's value is currently 1, remove it.
  • get_max: Return a key with the highest value.
  • get_min: Return a key with the lowest value.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions