We have a list of scores from your Kotlin tests. Please order them with the following criteria: odd elements first, then even elements.
Custom sort order for collection
Order your scores
Report a typo
Sample Input 1:
1 6 5 8 9 7 8Sample Output 1:
[1, 5, 9, 7, 6, 8, 8]Write 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.