You could use this to avoid the string conversions...
# getting-started
r
You could use this to avoid the string conversions:
Copy code
val zero = '0'.toInt()
fun calc(str: String) = str.map { it.toInt() - zero }.reduce(Int::times)