Kotlin HashSet maxOfWith()
Syntax & Examples


Syntax of HashSet.maxOfWith()

The syntax of HashSet.maxOfWith() extension function is:

fun <T, R> Iterable<T>.maxOfWith( comparator: Comparator<in R>, selector: (T) -> R ): R

This maxOfWith() extension function of HashSet returns the largest value according to the provided comparator among all values produced by selector function applied to each element in the collection.