complete 1092.kt 23029.kt 26587.kt 30553.kt

This commit is contained in:
2025-07-23 20:33:13 +09:00
parent bff1a8295b
commit 2e957b221e
4 changed files with 158 additions and 0 deletions

View 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)
}