Test if a number is divisible

Report a typo

You are given a lambda with a receiver isDivisible. Complete it to calculate if an integer number is divisible by another.

Sample Input 1:

4 2

Sample Output 1:

true
Write 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))
}
___

Create a free account to access the full topic