c++ | easy | short
\n# Code\n\nclass NumberContainers {\npublic:\n map<int,int> hm;\n    map<int,set<int>> mp;\n\n    \n    \n    NumberContainers() {\n        \n    }\n    \n    
\n# Code\n```\nclass NumberContainers {\npublic:\n map<int,int> hm;\n    map<int,set<int>> mp;\n\n    \n    \n    NumberContainers() {\n        \n    }\n    \n    void change(int index, int number) {\n        \n     if(hm.count(index)!=0){\n         int a = hm[index];\n         \n       \n        set<int>::iterator it;\n         \n         it = mp[a].find(index);\n         mp[a].erase(it);\n       \n         \n        \n         hm[index]= number;\n         \n         if(mp.count(number)!=0 && mp[number].size()!=0){\n             \n             mp[number].insert(index);\n        \n         }\n         else{\n             set<int> st ;\n             st.insert(index);\n             mp[number] = st;\n         }\n         \n     }\n        else{\n            \n            hm[index] = number;\n               if(mp.count(number)!=0){\n             \n             mp[number].insert(index);\n        \n         }\n         else{\n             set<int> st ;\n             st.insert(index);\n             mp[number] = st;\n         }\n            \n        }\n        \n        \n        \n    }\n    \n    \n    \n    int find(int number) {\n        \n       if(mp.count(number)!=0 && mp[number].size()!=0){\n           \n           return *mp[number].begin();\n       }\n        \n        return -1;\n\n    }\n};\n\n/**\n * Your NumberContainers object will be instantiated and called as such:\n * NumberContainers* obj = new NumberContainers();\n * obj->change(index,number);\n * int param_2 = obj->find(number);\n */\n```
['C++']