insert method
- K key,
- V value
Inserts a new key-value pair into the map. Time complexity: O(log N).
Implementation
void insert(K key, V value) {
if (!_container.containsKey(key)) {
_container[key] = [];
}
_container[key]!.add(value);
_size++;
}