Implement an LRU Cache

Asked at Zip · Coding Questions · Difficulty: Medium

Implement a **Least Recently Used (LRU) cache**: a store of key-value pairs with a fixed capacity that, when it is full and a new key arrives, discards the entry that has gone unused the longest. Both reading and writing a key count as using it.

Loading the problem…