Find the least recently used pages that is present in the set
int lru = int . MaxValue , val = int . MinValue ; foreach ( int itr in s ) { int temp = itr ; if ( indexes [ temp ] < lru ) { lru = indexes [ temp ] ; val = temp ; } }