Can you solve a classic data structure problem using an efficient algorithm?
Implement an LRU cache supporting get and put operations in O(1) average time. Use lru_cache_operations(capacity, operations), where each operation is ['get', key] or ['put', key, value]; return values for get operations, using -1 for missing keys. Keys and values are integers.
def lru_cache_operations(capacity, operations):