distinct By Key
Returns a new sequence containing only the first occurrence of each key.
Example:
val sequence = sequenceOf(1, 1, 2).assertSorted()
val distinct = sequence.distinctByKey()
assertEquals(listOf(1, 2), distinct.toList())
Content copied to clipboard
Return
A new sorted sequence with duplicate keys removed