erase method

int erase(
  1. K key
)

Removes all values associated with the exact key. Time complexity: O(log N).

Returns the number of elements removed.

Implementation

int erase(K key) {
  final removedList = _container.remove(key);
  if (removedList != null) {
    final count = removedList.length;
    _size -= count;
    return count;
  }
  return 0;
}