LRU Cache

 

146. LRU Cache

Solution - OrderedDict

[Reference](https://leetcode.com/problems/lru-cache/discuss/45952/Python-concise-solution-with-comments-(Using-OrderedDict)

OrderedDict = doubly linked list + hash map

  1. Update chache when get.
  1. If key is in dic when set, we don’t need to update remain, i.e. it’s not consuming capacity.