End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
get(key), check if the key exists in the cache. If not, return -1. If it does, increment the frequency, update the minimum frequency if needed, and return the value.put(key, value), if the key exists, update the value and frequency. If the cache is at capacity, remove the least frequently and least recently used key. Insert the new key with frequency 1.minf as needed.