Java || Two Maps || Easy to Understand
\nclass NumberContainers {\n    private class NumberContainer implements Comparable<NumberContainer> {\n        int index;\n        int number;\n        \n     
```\nclass NumberContainers {\n    private class NumberContainer implements Comparable<NumberContainer> {\n        int index;\n        int number;\n        \n        public NumberContainer(int index, int number) {\n            this.index = index;\n            this.number = number;\n        }\n        \n        public int compareTo(NumberContainer numberContainer) {\n            return Integer.compare(this.index, numberContainer.index);\n        }\n    }\n    \n    private HashMap<Integer, NumberContainer> indexCache;\n    private HashMap<Integer, PriorityQueue<NumberContainer>> numberHeapCache; \n    \n    public NumberContainers() {\n        indexCache = new HashMap<>();\n        numberHeapCache = new HashMap<>();\n    }\n    \n    // T = O(log(n)) | S = O(1)\n    public void change(int index, int number) {\n        if (!numberHeapCache.containsKey(number)) {\n            numberHeapCache.put(number, new PriorityQueue<>());\n        }\n        \n        NumberContainer numberContainer;\n        if (indexCache.containsKey(index)) {\n            numberContainer = indexCache.get(index);\n            \n            if (numberContainer.number == number) {\n                return;\n            }\n            \n            numberHeapCache.get(numberContainer.number).remove(numberContainer);\n            numberContainer.number = number;\n        } else {\n            numberContainer = new NumberContainer(index, number);\n            indexCache.put(index, numberContainer);\n        }\n        \n        numberHeapCache.get(number).add(numberContainer);\n    }\n    \n    // T = O(1) | S = O(1)\n    public int find(int number) {\n        if (!numberHeapCache.containsKey(number) || numberHeapCache.get(number).isEmpty()) {\n           return -1; \n        }\n        \n        return numberHeapCache.get(number).peek().index;\n    }\n}\n```
['Java']