Then asked me questions about complexity and why I designed it that way.
Implement count_cache_misses(requests, capacity) for a least recently used cache. Return the number of requests that are not currently cached. A cache hit refreshes that request's recency; a miss inserts it, and inserting beyond capacity evicts the least recently used request.
Input/output: requests is a list of integers, capacity is a positive integer, and the function returns an integer miss count.
def count_cache_misses(requests, capacity):