solution.py
⌘↵ runLoading...
LRU Cache
hardYou've got this! Start small, think out loud.
Design a data structure that follows the LRU (Least Recently Used) cache constraint. Implement `get(key)` and `put(key, value)` both in O(1) time. When capacity is exceeded, evict the least recently used key.
Time:O(1)
Space:O(capacity)
designhash-maplinked-listgoogle-favorite
OUTPUT
Run your code to see output