I have the same question. Anyone can tell us why?
same question. Why???
first get(2) return 1
then set(4,1), key 1 is removed(reach the capacity, last recently used element got removed)
get(1) return -1
get(2) return 1
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.