Hey PA,

I think that nub ~. is what you are looking for, although nub-sieve ~: might be 
useful as well.

    perms 12
2 2 3
2 3 2
2 2 3
2 3 2
3 2 2
3 2 2
   ~. perms 12 NB. unique items in order of appearance
2 2 3
2 3 2
3 2 2
   ~: perms 12 NB. mask of unique items
1 1 0 0 1 0
   
Cheers, bob

> On Jul 26, 2023, at 13:15, 'PMA' via Programming <programm...@jsoftware.com> 
> wrote:
> 
> perms =: 3 : 0
>   n=: !N=: $q:y
>   (i.n) A. q:y
> )

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to