用 map 和 链表来组织结构 struct node{ int key, val; node* pre; node* next; node(int k, int v): key(k), val(v), pre(nullptr), next(nullptr){}; }; class Solution { private: unordered_map<int, node*> mp; int cnt = 0; vector<int> res; node* head; ...