← 返回 linkedin 的题目列表Rankable Object Cache Implementation
类型:online_judge
Design a cache where the values are pre-defined Rankable objects. The eviction policy should be based on the size of value.rank().
Example
Input
cache = Cache(2)
cache.put('a', Rankable(5))
cache.put('b', Rankable(3))
cache.put('c', Rankable(4))
cache.get('a')
Output
None