function lruCacheMisses(num, pages, maxCacheSize) {
const cache = new Set();
let missCount = 0;
for (const page of pages) {
if (cache.has(page)) {
cache.delete(page);
} else {
missCount++;
}
cache.add(page);
if (cache.size > maxCacheSize) {
const lruPage = cache.values().next().value;
cache.delete(lruPage);
}
}
return missCount;
}