Design and implement a data structure for a Least Frequently Used (LFU) cache. Support get(key) and put(key, value) operations with O(1) average time complexity for both get and put.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.