complete 1092.kt 23029.kt 26587.kt 30553.kt
This commit is contained in:
11
storage/zeta/kt/completed/26587.kt
Normal file
11
storage/zeta/kt/completed/26587.kt
Normal file
@@ -0,0 +1,11 @@
|
||||
fun main() = with(System.`in`.bufferedReader()) {
|
||||
this.readLines().map {
|
||||
val words = it.split(' ').toMutableList()
|
||||
val vowelStarts =
|
||||
words.withIndex().filter { it.value.first().lowercaseChar() in listOf('a', 'e', 'i', 'o', 'u') }
|
||||
(vowelStarts zip vowelStarts.reversed()).forEach { (a, b) ->
|
||||
words[a.index] = b.value
|
||||
}
|
||||
words.joinToString(" ")
|
||||
}.forEach(::println)
|
||||
}
|
||||
Reference in New Issue
Block a user