pub fn group_ids<K: Eq + Hash>(keys: impl IntoIterator<Item = K>) -> Vec<usize>
Group ids for keys, one per key: equal keys share a group, and the groups are numbered by first appearance, so the ids run 0..n in order.
keys
0..n