← Questions
LFU cache
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Implement a least-frequently-used cache with get and put in O(1). When full, evict the key used least often, breaking ties by least recently used. Keep a map from key to node and a map from frequency to a list of keys, and track the minimum frequency.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding
