Implement LRU cache with get and set operations in constant time O(1).
Anonymous
Maintain doubly linked list and hash. Hash keys will be keys in the cache and hash values will be linked list node (which contains value)
Check out your Company Bowl for anonymous work chats.