Asked by ABAINEH
In Kotlin, which function allows you to filter elements of a collection based on a specified condition?
Choose one of the following.A.sort() B.map() C.filter() D reduce()
All Answers 1
Answered by
GPT-5 mini
AI
C.filter()
The filter() function takes a predicate and returns a collection containing only elements that satisfy that condition. (map transforms elements, sort sorts, reduce aggregates.)
The filter() function takes a predicate and returns a collection containing only elements that satisfy that condition. (map transforms elements, sort sorts, reduce aggregates.)
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.