Implement a well-known data structure (a specific one named by the interviewer) in the programming language of your choice.
For this task, implement an LRU cache. Provide get and put operations with O(1) average time complexity.
Use implement_lru_cache(capacity, operations), where operations contains commands such as ["put", key, value] and ["get", key]. Return an array containing the result of each get, using -1 for missing keys.
def implement_lru_cache(capacity, operations):