fn row_keys(groups: &[(GroupKey, Vec<usize>)], nrow: usize) -> Vec<GroupKey>
Invert groups into one key per row (nrow rows, row order). Each row of a key column lands in exactly one group, so every slot is filled.
nrow