Showing 2 questions
Design a data structure that acts as a Least Recently Used (LRU) cache. Implement methods to get and put key-value pairs, evicting the least recently used entry when the cache is full.
#1. LRU Cache
Simulate a stack where popping returns the most frequent element. If multiple elements have the same highest frequency, return the element closest to the top of the stack.
#2. Maximum Frequency Stack
Page 1 of 1 · 2 total