Implement an LRU Cache

Implement a fixed-capacity LRU (Least Recently Used) cache supporting the following operations:

  • GET key: If key exists, output its value and mark the key as most recently used; otherwise ou...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: