LRU Cache
Understand and implement the Least Recently Used cache algorithm by creating a class with set and get methods. Learn to manage cache capacity by evicting the least recently used items, enhancing your problem-solving skills with custom data structures for coding interviews.
We'll cover the following...
We'll cover the following...
Statement
Implement an LRU cache class with the following functions:
- Init(capacity): Initializes an LRU cache with the capacity size.
- Set(key, value): Adds a new key-value pair or updates an