Interview Guides
Design an LU cache that supports get(key) and put(key, value) in average O(1) time. The cache has a fixed positive integer capacity. get(key) returns the value for key if it exists, otherwise -1. put(key, value) inserts or updates the key; if the cache exceeds capacity, evict the least recently used key.
Implement a class LRUCache with methods get(key) and put(key, value).