### Generation
Before we can even enumerate, we need to generate a grouping. The simplest way is to extract groups of triplets, sequences, pairs and protoruns until there are no more (there can be leftover tiles that do not form a group).
However, that raises potential problems. The extraction process needs to follow some heuristic of a "good" grouping, and we might end up with repeat groupings (just in a different order). We could eliminate duplicates after the fact, but it should be a last resort.
#### Saved by the triplets and pairs
We can make use of the fact that triplets can only occur at most once as there are only 4 of each tile. Indeed, the major source of complexity stems from sequences and protoruns that can occur multiple times.
Hence, we can partition the problem for each combination of triplets, and work on finding the other groups in each split. For example, for the tileset {1, 2, 2, 2, 3, 3, 3, 4} there are 4 partitions: both 2 and 3, only 2, only 3 and neither.
As there are a maximum of 4 triplets in a tileset, the maximum number of partitions we will ever need to consider is tex`2^4=16`, which is still managable.
For the pairs, we can make use of the fact that we will not want more than 3 pairs in a hand. As there is a maximum of 6 pairs in a hand, there is a maximum of tex`{6\choose3}+{6\choose2}+{6\choose1}+{6\choose0}=42` different partitions for pairs.
#### A mild ordering
We are left with sequences and protoruns, which we can extract as much as the tileset has. To be systematic about it, we can