(self, key: int)
| 18 | self.tail.prev = self.head |
| 19 | |
| 20 | def get(self, key: int) -> int: |
| 21 | if key not in self.hashmap: |
| 22 | return -1 |
| 23 | # To make this key the most recently used, remove its node and |
| 24 | # re-add it to the tail of the linked list. |
| 25 | self.remove_node(self.hashmap[key]) |
| 26 | self.add_to_tail(self.hashmap[key]) |
| 27 | return self.hashmap[key].val |
| 28 | |
| 29 | def put(self, key: int, value: int) -> None: |
| 30 | # If a node with this key already exists, remove it from the |
no test coverage detected