Skip to content

Instantly share code, notes, and snippets.

@Samarthi
Samarthi / lru_cache.py
Last active September 4, 2025 19:56
An LRU Cache with a dictionary like interface
from typing import List, Optional, Any
class Node:
"""
Key value pair in cache
args:
key: key of the cached element
value: value of the cached element
"""
def __init__(self, key=None, value=None):