Neo is trying to hack the Matrix. He has a list of codes, but to solve this challenge, he must take only the odd numbers, multiply them by 2, then chunk the list into groups of 2 numbers, summarise the numbers in each chunk, and finally print the resulting list.
Sequences
Hacking the Matrix
Report a typo
Sample Input 1:
1 2 3 8 10 10 11 13 5Sample Output 1:
[8, 48, 10]Write a program in Kotlin
fun main() {
val sequence = readln().split(" ").map { it.toInt() }.asSequence()
// write your code here
}
___
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.