indexOfBestBy

internal inline fun <C> Sequence<C>.indexOfBestBy(isBetterThan: IsBetterThan<C>): Int

Returns the index of the first element in this sequence that is better than all previous elements.

Returns -1 if there are no elements in this.

Considers the first element in this the best if isBetterThan only returns false.

Parameters

isBetterThan

A function defining what it means for a value to be "better" than another.