# Getting all possible solutions

Okay, this is for VB6..

What I want to know is how I can get all possible solutions of a set base of letters.

What I would want though, is to be able to 'input' 6 letters and get all the possible solutions and place them in a array. Letters CAN be the same.. For example, Letter 1 = A, Letter 2 = B, Letter 3 = B, Letter 4 = C, Letter 5 = C, Letter 6 = E, some of the results would be

ABBCCE
ABBCEC
ABBECC
ABEBCC
AEBBCC
EABBCC
ABCBCE
ACBBCE
CABBCE
...etc

It doesn't matter if there duplicates however due to the same letter, that's fine by me.. But I was hoping for a simple solution instead of manualy doing each one. Is there any way to get all the solutions? Thanks!
LVL 7
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
What you want are the permutations of those 6 characters :

http://en.wikipedia.org/wiki/Permutation

There are 6! = 720 different permutations of 6 characters
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
Here's some VB code :

http://www.vbi.org/Items/article.asp?id=133
0
Commented:
If there are 2 B's and 2 C's the number of permutations would be 6!/(2!2!)
0
Commented:
0
Commented:
>> If there are 2 B's and 2 C's the number of permutations would be 6!/(2!2!)

I was following this :

>> It doesn't matter if there duplicates however due to the same letter, that's fine by me..

;)
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.