val names = arrayOf("Alice", "Bob", "Charlie") // {Alice=5, Bob=3, Charlie=7} names.associateBy({ it }) { it.count() }.forEach { _console.log(it) }