Lazy minimum (fast 100%)
IntuitionUse dictionaries for indicies of number and containersApproachcalculate minimum of indicies only one timeComplexity

Time complexity:
O(1)


Space comp
# Intuition
Use dictionaries for indicies of number and containers

# Approach
calculate minimum of indicies only one time

# Complexity
- Time complexity:
$$O(1)$$

- Space complexity:
$$O(n)$$

# Code
```python []
class NumberContainers(object):
    minInd = {}
    content = {}

    def __init__(self):
        self.minInd = {}
        self.content = {}

    def change(self, index, number):
        """
        :type index: int
        :type number: int
        :rtype: None
        """
        
        oldNum = self.content.get(index,None)
        if oldNum:
            if oldNum == number:
                return
            oldInds,c = self.minInd[oldNum]
            if len(oldInds) > 1:
                oldInds.remove(index)
                self.minInd[oldNum] = (oldInds,-1)
            else:
                self.minInd.pop(oldNum)

        indList,c = self.minInd.get(number,(set(),-1))
        indList.add(index)
        self.minInd[number] = (indList,-1)
        self.content[index] = number
        

        

    def find(self, number):
        """
        :type number: int
        :rtype: int
        """
        pair = self.minInd.get(number,None)
        if pair:
            res,c = pair
            if c == -1:
                c = min(res)
                self.minInd[number] = (res,c)
            return c
        else:
            return -1
    
        


# Your NumberContainers object will be instantiated and called as such:
# obj = NumberContainers()
# obj.change(index,number)
# param_2 = obj.find(number)
```
['Python']