Design and implement an LRU cache with get and put operations.
Sample Input:
["LRUCache","put","put","get","put","get","put","get","get","get"], [[2],[1,1],[2,2],[1],[3,3],[2],[4,4],[1],[3],[4]]
Sample Output:
[null,null,null,1,null,-1,null,-1,3,4]
Hints
Hint 1
Use hash map for O(1) access
Hint 2
Use doubly linked list to maintain order
Hint 3
Move accessed nodes to front of list