MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / __init__

Method __init__

python/0146-lru-cache.py:8–13  ·  view source on GitHub ↗
(self, capacity: int)

Source from the content-addressed store, hash-verified

6
7class LRUCache:
8 def __init__(self, capacity: int):
9 self.cap = capacity
10 self.cache = {} # map key to node
11
12 self.left, self.right = Node(0, 0), Node(0, 0)
13 self.left.next, self.right.prev = self.right, self.left
14
15 # remove node from list
16 def remove(self, node):

Callers

nothing calls this directly

Calls 1

NodeClass · 0.70

Tested by

no test coverage detected