Inserts or updates the value associated with the specified key. If the key exists, it updates the value and moves the node to the head. If the key is new, it adds the key-value pair and evicts the LRU item if over capacity.
The key to insert or update.
The value to associate with the key.
Class representing an LRU (Least Recently Used) Cache. The cache evicts the least recently used items when the maximum capacity is reached.
Example