Tag: permutation algorithm with duplicates