Hashing
\nclass NumberContainers {\npublic:\n    map<int, int> indexToNumber; // stores number corresponding to an index.\n    map<int, set<int>>numberToIndex; // store
```\nclass NumberContainers {\npublic:\n    map<int, int> indexToNumber; // stores number corresponding to an index.\n    map<int, set<int>>numberToIndex; // stores all the indexes corresponding to a number.\n    NumberContainers() {}\n        \n    void change(int index, int number) {\n        \n        if (!indexToNumber.count(index)) { // if there is no number at the given index.\n            numberToIndex[number].insert(index); // store index corresponding to the given number\n            indexToNumber[index] = number; // store number corresponding to the index.\n        }\n        else { // Update both map.\n            \n            int num = indexToNumber[index]; // number at given index currently.\n            \n            // remove the index\n            numberToIndex[num].erase(index); \n            if (numberToIndex[num].empty())    numberToIndex.erase(num);\n            \n            //  insert the new number at the given index and store the index corresponding to that number.\n            numberToIndex[number].insert(index);\n            indexToNumber[index] = number;\n        }   \n    }\n    \n    int find(int number) {\n        if (!numberToIndex.count(number))   return -1;\n        // returning first element in the set as it will be the smallest index always.\n        return *numberToIndex[number].begin(); \n    }\n};\n```\n
['C', 'Ordered Set']