We are planning to design a system where following operations are supported.
Increment("foo"): Increase the count of key 'foo'
Decrement("bar"): Decrease the count of key 'bar'
getMin(): Return the key which has minimum count
getMax(): Return the key which has maximum count
The catch is all operations should be in $O(1)$ time.