← 返回 meta 的题目列表Data Storage with Last Accessed Key
类型:online_judge
Design a data storage system supporting the following operations:
put(K k, V v): Store the pair (k, v) in the system.
get(K k): Return the value associated with key k.
last(): Return the most recently accessed key.
delete(K k): Remove the key k and its associated value from the system.
Example:
put("a", 1) put("b", 2) get("a") last() # returns "a" delete("a") last() # returns "b"
Example
Input
put a 1
put b 2
get a
last
delete a
last