
30 Nov
2008
30 Nov
'08
3:27 p.m.
Jake Mcarthur wrote:
Heh, after a couple more seconds of thought, reversing the two composed functions fixes it:
nub . permutations
Of course, neither my previous nonsolution nor this solution are efficient for long lists, but I think it serves as a decent reference implementation at least.
Consider the following list: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] Somebody just pointed out to me that this list has 87,178,291,200 permutations, of which 14 are unique. O_O