easy map and set solution
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class NumberContainers {
public:
    unordered_map<int, int> ind_num;
    unordered_map<int, set<int>> smallind;
    NumberContainers() {}

    void change(int index, int number) {
        
        if (ind_num.find(index) != ind_num.end() && ind_num[index] != number) {
            smallind[ind_num[index]].erase(index);
            if(smallind[ind_num[index]].size()==0){
                smallind.erase(ind_num[index]);
            }

        }
        smallind[number].insert(index);
        ind_num[index] = number;
    }

    int find(int number) {
        if (smallind.find(number) == smallind.end())
            return -1;
        int firstNum = *smallind[number].begin();
        return firstNum;
    }
};

/**
 * Your NumberContainers object will be instantiated and called as such:
 * NumberContainers* obj = new NumberContainers();
 * obj->change(index,number);
 * int param_2 = obj->find(number);
 */
```
['Hash Table', 'Design', 'Ordered Set', 'C++']