Map + LinkedList. But Javascript Map actually keeps track of the key in order, so built-in map would be sufficient enough
Here is my code https://github.com/JSerZANP/leetCode_...
Hi I'm a JavaScript engineer who is not good at algorithms,
and currently practicing leetCode online. If you are interested, maybe we can learn together.
On this page of the site you can watch the video online LeetCode 146. LRU Cache | JavaScript & Algorithm with a duration of hours minute second in good quality, which was uploaded by the user JSer 29 May 2020, share the link with friends and acquaintances, this video has already been watched 3,680 times on youtube and it was liked by 31 viewers. Enjoy your viewing!