Implement an LRU Cache.
Asked in the Final Round, Round 3, Hiring Manager stage. The task was asked in the last 20 minutes of the final interview round.
Implement lru_cache(capacity, operations). capacity is a positive integer. Each operation is ['put', key, value] or ['get', key]. Return an array containing the result of every get: the stored value, or -1 if the key is absent. A put updates an existing key and marks it as most recently used. When the cache exceeds capacity, evict the least recently used key.
def lru_cache(capacity, operations):