kotlin.sequences.groupBy

groupBy

inline fun <T, K> Sequence<T>.groupBy(
    keySelector: (T) -> K
): Map<K, List<T>>

Groups elements of the original sequence by the key returned by the given keySelector function applied to each element and returns a map where each group key is associated with a list of corresponding elements.

The returned map preserves the entry iteration order of the keys produced f