Spaces:
Sleeping
Sleeping
| class LRUCache: | |
| def __init__(self, capacity: int): | |
| # TODO: Initialize your cache data structures here | |
| pass | |
| def get(self, key: int) -> int: | |
| # TODO: Return the value if key exists, otherwise return -1. | |
| # Accessing an item makes it the most recently used. | |
| pass | |
| def put(self, key: int, value: int) -> None: | |
| # TODO: Add key-value pair. If capacity is exceeded, evict the least recently used item. | |
| pass |