After set(2,1),set(1,1),get(2), the LRU is (1,1) because you just used get(2), so the next step set(4,1) will remove (1,1). Therefore, get(1) return -1, get(2) return 1.

When get() is called, the priority of this number in cache if it exists in the cache is promoted.
Meanwhile, the set() will not promote the priority of number in cache.
I think above is what "LRU" actually means.

Set also need promote, used means "accessed", include both operation of get() and set(). At least in leetcode that's the rule, I'm not sure how the real operaion system define it :)