Two Maps
\nclass NumberContainers {\npublic:\n    unordered_map<int,int>mp;\n    unordered_map<int,priority_queue<int,vector<int>,greater<int>>>mp1;\n    NumberContainer
```\nclass NumberContainers {\npublic:\n    unordered_map<int,int>mp;\n    unordered_map<int,priority_queue<int,vector<int>,greater<int>>>mp1;\n    NumberContainers() {}\n    \n    void change(int index, int number) \n    {\n        if(mp.find(index)!=mp.end())//updation\n        {\n            if(mp[index]==number)return;\n            int val=mp[index];\n            vector<int>vals;\n            while(!mp1[val].empty())\n            {\n                int x=mp1[val].top();\n                mp1[val].pop();\n                if(x!=index)vals.push_back(x);\n                else break;\n            }\n            for(auto i:vals)mp1[val].push(i);\n            if(mp1[val].empty())mp1.erase(val);\n        }\n        mp[index]=number;\n        mp1[number].push(index);\n    }\n    \n    int find(int number) {\n        if(mp1.find(number)!=mp1.end())\n        {\n            return mp1[number].top();\n        }\n        return -1;\n    }\n};\n```
['C', 'Heap (Priority Queue)']