I am trying to generate some lists of permutations of ints but I can't make std::next_permutation work for me. The problem is I need to include permutations which don't use every number.
For example take the array of numbers [1, 2]. I need an algo that will return:
The OP wants a "permutation" where it doesn't have to use each number. Their example for 12 has "permutations" of 1 2 12 21 while a permutation would have 12 21.
Ah yeah, you are correct they could get all the unique substrings and use std::next_permutation on them, I thought you just mean to try it again since they tried it already :P