Skip to main content
LRU Cache | AlgoCracked
AlgoCracked
ProblemsLRU Cache
Medium42.0% acceptance
Blind75Hash TableLinked ListDesign

LRU Cache

Design a least-recently-used cache with a fixed capacity. get(key) returns the value or -1 ; put(key, value) inserts/updates and evicts the least-recently-used entry when over capacity. Both run in O(1) average. LRUCache(capacity) constructs it. Input format Operation names + parallel argument lists.

Loading workspace…