[Jprogramming] Permutations

Henry Rich HenryHRich at nc.rr.com
Fri Sep 23 05:53:49 HKT 2011


The digits, you mean?

    -:&:(/:~)&:(10&#.^:_1)"0

would be one way.  Is 35 a permutation of 503?

Henry Rich

On 9/22/2011 5:41 PM, David Vaughan wrote:
> Hi, what is the best (fastest) way to check whether a number is a permutation of another number?
> I've tried listing all permutations of one number and checking whether the other number is in the list of permutations. This seems pretty slow, so I was hoping for a faster method.
>
> Thanks.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


More information about the Programming mailing list