11/37
Part 2 of 6 · The LRU orderWatch
Watch · 6 min

The same design drawn out on the capacity-2 example. A hash map from each key to its node, a doubly linked list with dummy nodes at both ends, the left end least recently used and the right end most recent, and the eviction when a third key arrives.

LRU Cache - Twitch Interview Question - Leetcode 146 · NeetCode · Dec 2020YouTube