Design a Least Frequently Used cache with get(key) and put(key, value) in O(1) average time. When capacity is exceeded, evict the least frequently used key; break ties by evicting the least recently used among them.
Practise this challenge
All coding challenges