In the game only String

Report a typo

Write a function that accepts a list of objects and returns only those list items that are strings.

Sample Input 1:

"apple", 1, "banana", 2, "orange"

Sample Output 1:

[apple, banana, orange]
Write a program in Kotlin
fun <T> getStringsOnly(list: List<T>): List<String> {
val result = mutableListOf<String>()
// make your code here
return result
}
___

Create a free account to access the full topic