CPP One Map Easy Sol'n
It\'s very simple, we want to insert a number at index i. In the case of an existing number, we need to update it. In this case, we will use a map since it stor
It\'s very simple, we want to insert a number at index i. In the case of an existing number, we need to update it. In this case, we will use a map since it stores the index sorted. This allows us to automatically return the first index  whenever we need to find some element.\n\n```cpp\nclass NumberContainers {\npublic:\n    map<int, int> mp;\n    NumberContainers() \n    {\n\n    }\n    \n    void change(int index, int number)\n    {\n        mp[index] = number;\n    }\n    \n    int find(int number)\n    {\n       for(auto it: mp){\n           if(it.second == number) return it.first;\n       }\n        \n       return -1;\n    }\n};\n```
['C++']