Design a cache with fixed capacity that evicts the least-recently-used
entry when full. Both get and put should run in amortised O(1).
API
get(key) → returns the value if present and marks the key as most recently used; otherwise returns -1.
put(key, value) → inserts or updates. If the cache is full and the keyis new, evict the least-recently-used entry first.
solve(capacity, ops) replays a list of operations and returns one entry per
op (null for puts, the gotten value or -1 for gets).
Sample tests