3 ms·
and in Kotlin fun alignLines(lines: List<String>): List<String> { val maxLength = lines.map { it.length }.max()!! return lines.map { " ".re
by sorokod 7y ago
and in Kotlin
fun alignLines(lines: List<String>): List<String> {
val maxLength = lines.map { it.length }.max()!!
return lines.map { " ".repeat((maxLength - it.length) / 2) + it }
}