More Kotlin

Report a typo

Define a generic function countItem() that counts how many times the argument item passed to the function occurs in List. Below you can see the parameter names and types the function accepts and its result type.

Input:

list: List<T>, item: T

Output:

Int

Write a program in Kotlin
// implement your function here
fun countItem()
___

Create a free account to access the full topic