Leetcode – 146. LRU Cache

Problem Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache class: The functions get and put must each run in O(1) average time complexity. Example 1: Solution Python has OrderedDict which is suitable for this task Result See also  Leetcode – 12. Integer to Roman