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 – 16. 3sum closest (yeah… threesum … Continue reading Leetcode – 146. LRU Cache