lastIndexOf

Returns last index of element, or -1 if the sequence does not contain element.

fun <T> Sequence<T>.lastIndexOf(element: T): Int(source)
fun main() {
    val seq = sequenceOf("apple", "banana", "cherry", "banana")
    val index = seq.lastIndexOf("banana")
    println("Last index of 'banana' is $index") // prints: Last index of 'banana' is 3
}

Source