'Inserts a new key <Key> with value 1. Or increments an existing key by 1.
:type key: str
:rtype: void'

def inc(self, key):

    if (key not in self.bucket_of_key):
        self.bucket_of_key[key] = self.buckets.insert(self.buckets.begin(), Node(0, set([key])))
    (bucket, next_bucket) = (self.bucket_of_key[key], self.bucket_of_key[key].next)
    if ((next_bucket is self.buckets.end()) or (next_bucket.value > (bucket.value + 1))):
        next_bucket = self.buckets.insert(next_bucket, Node((bucket.value + 1), set()))
    next_bucket.keys.add(key)
    self.bucket_of_key[key] = next_bucket
    bucket.keys.remove(key)
    if (not bucket.keys):
        self.buckets.erase(bucket)
