Permutation with duplicates.