C++ || Runtime: O(log n) || Maps, Commented Solution
Structures used:\n numToConts - a map that maps a number with a set(containing the indices that number is stored) \n contToNum - a map that maps the index and t
### Structures used:\n* numToConts - a map that maps a number with a set(containing the indices that number is stored) \n* contToNum - a map that maps the index and the value stored at that index\n\n### Code:\n\n```\nclass NumberContainers {\npublic:\n    unordered_map<int, set<int>> numToConts; \n    unordered_map<int, int> contToNum; \n    \n    NumberContainers() {}\n    \n    void change(int index, int number) {\n        if(contToNum.find(index) == contToNum.end()) {          // if there is no number in the container with given index, \n                                                                // we straight-away insert the given number at given index\n            numToConts[number].insert(index);\n            contToNum[index] = number;\n        } else if (contToNum[index] == number) {                // if there is a number in given index but that matches the given \n                                                                // number, we need not do any thing as end result will be the same \n            return;             \n        } else {                                                // if there is a number(say x) in given index and it is different than given number then.\n            numToConts[contToNum[index]].erase(index);          // unassign the given index from x\n            numToConts[number].insert(index);                   // assign the index to the given number \n            contToNum[index] = number;                          // update the number in corresponding to the given index\n        }\n    }\n    \n    int find(int number) {\n        // if the number exists and there is a possible index for it then return that\n        if(numToConts.find(number) != numToConts.end()  and  numToConts[number].size() != 0)    \n            return *(numToConts[number].begin());\n        return -1;                                               // else return -1\n    }\n};\n```
['C++']