Design a counter that can also report its most and least counted keys, with every operation in O(1).
new AllOne()inc(key) - add 1 to the key's count, creating the key at 1 if it is newdec(key) - subtract 1 from the key's count; a count that reaches 0 removes the key. Decrementing a key that is not there does nothinggetMaxKey() - any key with the largest count, or '' when the structure is emptygetMinKey() - any key with the smallest count, or '' when empty
When several keys tie, any one of them is acceptable.