Refactored LRU Cache problem solution