set

operator fun set(key: K, value: V): K?

HashMap put and remove is O(1). More info: https://stackoverflow.com/a/4578039/2085356