Consider capacity = 3. Call put(A,1), put(B,2), put(C,3). All keys sit at frequency with minFreq = 1. The frequency- group holds [A, B, C] in insertion order.
Now get(B) promotes B to frequency . Frequency- becomes [A, C], frequency- holds [B]. minFreq stays at .
Calling put(D,4) triggers eviction. The oldest key in the minFreq = 1 group is A, so A is removed. D enters at frequency , giving [C, D] at frequency and [B] at frequency .
Each get and put performs a constant number of hash map lookups and linked-list moves, giving time per operation. Space is since you store at most capacity keys across all structures.