Amazon Interview Question

it was a LRU cache leetcode problem.