Algorithm to generate all multiset size-n partitions
问题 I've been trying to figure out a way to generate all distinct size-n partitions of a multiset, but so far have come up empty handed. First let me show what I'm trying to archieve. Let's say we have an input vector of uint32_t : std::vector<uint32_t> input = {1, 1, 2, 2} An let's say we want to create all distinct 2-size partitions. There's only two of these, namely: [[1, 1], [2, 2]], [[1, 2], [1, 2]] Note that order does not matter, i.e. all of the following are duplicate, incorrect solutions