Design LFU Cache
Design a cache with capacity cap supporting get k and put k v. When full, put evicts the least frequently used key; ties are broken by evicting the least recently used among them. A get miss prints -1.
Constraints
1 <= cap <= 10^4 O(1) per operation expected
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.