Re: Combination or Permutation question!
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Combination or Permutation question!

From: Oli Filth <catch@olifilth.co.uk>
Date: Tue Mar 28 2006 - 16:13:23 CEST

Oli Filth wrote:
> kanka wrote:
> > Here is my problem,
> >
> > I have a string like $numbers="12345";
> >
> > i wanna find out all possible (unique) combinations of each subs.
> > e.g. 1 - 2 - 3 - 4 - 5 - 12 - 13 - 14 - 15 - 23 - 24 - ..... - 234 -
> > 245 - .... - 12345
> > but not 11 - 22 - 21 - 32 - 321....
> >
>
> This sound like you want *permutations*, not *combinations*.

Oops, no, I misread. You do want combinations.

Still, it won't be hard to modify the code I posted to do combinations
instead.

-- 
Oli
Received on Mon May 1 02:42:49 2006