inverted

fun <K, V> Map<K, V>.inverted(): Map<V, K>

Returns a map from each value to its key.

When several keys map to the same value, the key of the last entry in iteration order wins. Entries are ordered by first occurrence of each value.