Designing Efficient Number Containers For Large Datasets
Design a number container system with O(log n) time complexity for change and find operations using hash maps and min-heaps.
2349. Design a Number Container System Difficulty: Medium Topics: Hash Table, Design, Heap (Priority Queue), Ordered Set Design a number container system that can do the following: Insert or Replace a number at the given index in the system. Return the smallest index for the given number in the system. Implement the NumberContainers class: NumberContainers() Initializes the number container system. void change(int index, int number) Fills the container at index with the number. If there is already a number at that index, replace it. int find(int number) Returns the smallest index for the gi...