Object-Oriented Programming · Google · Medium
Problem Create an LRU cache class whose constructor receives the cache's maximum number of entries. The class must provide get(key) and put(key, value) operations. If adding a new entry would exceed the capacity, discard the entry that has gone unused for the longest time before inserting it. get(key) returns the value associated with key when that key is cached; if it is absent, return -1. put(key, value) inserts a new key-value pair or replaces the value for an existing…
Checking your access…