Map and Ordered set
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>mp;
    set<pair<int, int>> st2;
    NumberContainers() {}

    void change(int index, int number) {
       int it=mp[index];
        if (it!=0) {
            auto it2 = st2.find({mp[index], index});
            st2.erase(it2);
        }
        mp[index]=number;
        st2.insert({number, index});
    }

    int find(int number) {
        auto it2 = st2.lower_bound({number,INT_MIN});
        if(it2!=st2.end()&&it2->first==number) return it2->second;
        return -1;
    }
};

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