Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/neetcode-gh/leetcode
/ insert
Method
insert
python/0146-lru-cache.py:21–24 ·
view source on GitHub ↗
(self, node)
Source
from the content-addressed store, hash-verified
19
20
# insert node at right
21
def
insert(self, node):
22
prev, nxt = self.right.prev, self.right
23
prev.next = nxt.prev = node
24
node.next, node.prev = nxt, prev
25
26
def
get(self, key: int) -> int:
27
if
key in self.cache:
Callers
2
get
Method · 0.95
put
Method · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected