Write a function that takes a list of objects and returns the number of strings in the list. If a list item is not a string, skip it. The function must use the is or !is operators to check the type of list items.
Type cast and smart cast
Writing a string counter
Report a typo
Write a program in Kotlin
fun countStrings(list: List<Any>): Int {
// make your code here
}
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.