I'm curious why in your case 1,2,3,4,5,6 is considered to be the same as
1,2,3,4,6,5?  I was going to suggest that you use n! to figure out how many
possible permutations of the string there were, but that wouldn't work given
your requirements.

Chris


On 9/25/07, Ken Fassman <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I have a problem I'm struggling to solve in ColdFusion - I wonder if
> someone
> can help me with.
>
> I am being given a variable length, numeric string (min 6, max 20).  I
> need
> to show all combinations of those values that will result in a unique set
> of
> 6.  The resulting output is sorted - so 1,2,3,4,5,6 is the same as
> 1,2,3,4,6,5.
>
> I'd also like to see if there is an easy way to calculate the expected
> number of each in advance.
>
> Just to illustrate what I'm looking to do (in case its not clear from
> above):
>
> The input string might be "1,2,3,4,5,6,7" and I'd need to return the
> following results:
> 123456
> 123457
> 123467
> 123567
> 124567
> 134567
> 234567
>
>
> Any thoughts on this on how to approach this are greatly appreciated.
>
> Thanks!
>
> - KsF
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289434
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to