You are given a lambda with a receiver isDivisible. Complete it to calculate if an integer number is divisible by another.
Lambda with receiver
Test if a number is divisible
Report a typo
Sample Input 1:
4 2Sample Output 1:
trueWrite a program in Kotlin
val isDivisible: Int.(Int) -> Boolean = {
// write your code here
}
/* Do not change code below */
fun main() {
val (a, b) = readln().split(' ').map { it.toInt() }
println(a.isDivisible(b))
}
___
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.