#include <map> struct MyListNode { MyListNode *pre = nullptr; MyListNode *next = nullptr; int key; int value; public: MyListNode(int k, int v) : key(k), value(v) {} MyListNode() {} }; class Solution { private: int cap; MyListNode *hair; MyListNode *tair; ...