jira-to-code / src /jira_to_code /tasks /hard /lru_cache.py
Navigam's picture
eas inferenece and added hard, mdeium task
769cea2
Raw
History Blame Contribute Delete
467 Bytes
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