Implement a solution for a specific data structure problem without using built-in libraries for Crypto backend code.
Implement an LRU cache from scratch. Use a custom hash table and doubly linked list, without dict, set, OrderedDict, or external libraries.
Implement lru_cache(capacity, operations). Each operation is ['put', key, value] or ['get', key]. Return a list containing the result of every get, using -1 for a missing key. A successful get and every put mark the key as most recently used.
def lru_cache(capacity, operations):