Skip to the content.

Asked by Google

Question

Implement a key value store, where keys and values are integers, with the following methods:

For example, if we ran the following calls:

kv.update(1, 1)
kv.update(2, 1)

And then called kv.max_key(1), it should return 2, since it's the largest key with value 1.