Returns a list of the groups with the given indices.
The list contains the strings returned by group for each index in groupIndices.