Design data structure supporting increment, decrement, and getMin/getMax in O(1).
Sample Input:
["AllOne","inc","inc","getMax","inc","getMax","dec","getMin"], [[],["hello"],["hello"],[],["hello"],[],["hello"],[]]
Sample Output:
[null,null,null,"hello",null,"hello",null,"hello"]
Hints
Hint 1
Use doubly linked list of buckets
Hint 2
Each bucket contains keys with same count
Hint 3
Maintain hashmap from key to bucket