struct Node { int key; int val; Node *next; Node *pre; Node(): key(0), val(0), next(nullptr), pre(nullptr) {} Node(int _key, int _val): key(_key), val(_val), next(nullptr), pre(nullptr) {} }; class Solution { private: unordered_map<int, Node*> hashtable; int ca...