I'm not sure exactly what you want to remove, but it sounds like you
might be looking for something like:

(set (map sort (selections [1 2 3 4 5] 3)))

or:

(for [i (range 1 6) j (range i 6) k (range j 6)] [i j k])

On Sun, Feb 1, 2009 at 8:12 PM, kyle smith <the1physic...@gmail.com> wrote:
>
> The selections function in combinatorics returns more than what I
> need.  (selections [ 1 2 3 4 5] 3) will return both (1 2 3) and (3 2
> 1), etc.  However, I still need (1 1 1) (2 2 2), etc.  I've tried
> several times to write a function to filter out the 'duplicates', but
> haven't quite got it.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to