The interface should expose set, not put, since put doesn't overwrite the keys, which is the entire point of an LRU cache. Using put causes duplicate keys.
The interface should expose set, not put, since put doesn't overwrite the keys, which is the entire point of an LRU cache.
Using put causes duplicate keys.