Neo is trying to hack the Matrix. He has a list of codes, but to solve this challenge, he must write the sum of two elements – one found at the very beginning and one at the end of the collection. Please help Neo find the code to hack the Matrix.
Retrieve single element
Hacking the Matrix
Report a typo
Sample Input 1:
1 2 3 8 10 10Sample Output 1:
11Write a program in Kotlin
fun main() {
val list = readln().split(" ").map { it.toInt() }
// write your code here
val res =
println(res)
}
___
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.