LRU Cache Design and implement a data structure for LRU (Least Recently Used) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.set(key, value) - Set or insert the value if the key is not already present. When the cache reaches its capacity, it should invalidate the least recently.. 더보기 이전 1 다음