Suppose you have a numbers array of the IntArray type. Swap its first and last elements. It is guaranteed that the size of the array is larger than 0.
Arrays
Swap elements
Report a typo
Write a program in Kotlin
fun main() {
val numbers = readLine()!!.split(' ').map { it.toInt() }.toIntArray()
// Do not touch lines above
// Write only exchange actions here.
// Do not touch lines below
println(numbers.joinToString(separator = " "))
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.