minWith

@JvmName(name = "minWithOrThrow")
fun <T> Sequence<T>.minWith(comparator: Comparator<in T>): T(source)

Returns the first element having the smallest value according to the provided comparator.

The operation is terminal.

Since Kotlin

1.7

Throws

if the sequence is empty.

fun <T> Sequence<T>.minWith(comparator: Comparator<in T>): T?(source)

Deprecated

Warning since 1.4

Error since 1.5

Hidden since 1.6

Use minWithOrNull instead.

Replace with

this.minWithOrNull(comparator)

Since Kotlin

1.0