LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.
get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
put(key, value) - Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item.
A. Use a hashmap linked with a doubly linked list
B. Implement with a simple array structure
C. Use a stack for maintaining the order of use
D. Apply a queue for first-in-first-out management