LRU cache approach with stack