Multiply the numbers by 2

Report a typo

We are writing a function that takes a list of objects of type Any and returns a new list, in which all integers (Int) are multiplied by 2, and all other elements are left unchanged.
Write the missing code using the is and !is operators to cast the types.

Write a program in Kotlin
fun multiplyInts(list: List<Any>): List<Any> {
val result = mutableListOf<Any>()
for (item in list) {
when (item) {
// make your code here
}
}
return result
}
___

Create a free account to access the full topic