Simple TreeSet approach for the bruzz. I luv ts.
Code


# Code
```java []
class NumberContainers {

    Map<Integer,TreeSet<Integer>> numberToIndex;
    Map<Integer,Integer> indexToNumber;
    public NumberContainers() {
        numberToIndex = new HashMap<>();
        indexToNumber = new HashMap<>();
    }
    
    public void change(int index, int number) {
        int oldNumber = -1;
        if(indexToNumber.containsKey(index))
            oldNumber = indexToNumber.get(index);
        indexToNumber.put(index,number);
        if(oldNumber != -1)
            numberToIndex.get(oldNumber).remove(index);
        
        TreeSet<Integer> newNumberIndices = numberToIndex.getOrDefault(number,new TreeSet<>());
        newNumberIndices.add(index);
        numberToIndex.put(number,newNumberIndices);
    }
    
    public int find(int number) {
        TreeSet<Integer> numberIndices = numberToIndex.get(number);
        return (numberIndices == null || numberIndices.size() == 0) ? -1 : numberIndices.first();
    }
}

/**
 * Your NumberContainers object will be instantiated and called as such:
 * NumberContainers obj = new NumberContainers();
 * obj.change(index,number);
 * int param_2 = obj.find(number);
 */
```
['Java']