With an array, this solution is very easy to implement but the time complexity would be O(n), and the question asks for O(1)
Have dummy head and tail pointers.
Whenever inserting a new node, insert it right after head.
This way, the least recently used node is the node before tail.
Whenever you get a key, we need to move it to the most recently used (i.e. near head), so you can either delete and insert after head, or change the node's pointers (and also the pointers of it's prev and next)
Also remember that whenever evicting a key, remove it from your hashmap as well.