Shopee interview question

Implement an lru cache with time and space complexity explained