Design and implement a data structure for a Least Frequently Used (LFU) cache.
get(key): Returns the value ifkeyexists, else-1. Each access (get or put-existing) increments the key's frequency by 1.put(key, value): Insert or update. If at capacity, evict the least frequently used key. Tie-break by the least recently used among keys with the lowest frequency.
Both operations must run in O(1) average time.
For the auto-grader: implement lfuCacheOps(capacity, operations) returning the result of each call in order:
["put", key, value]→null/None["get", key]→ value or-1