You are given a list of numbers. Write a filtering function that returns a list of numbers where each number is divisible by 3.
Filtering elements in collection
Are they divisible by 3?
Report a typo
Sample Input 1:
1 2 3 4 5 6 7 8 9Sample Output 1:
[3, 6, 9]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.