How to get all permutations for data existing in two different arrays??

  • Thread starter Thread starter StudiousStudent
  • Start date Start date
S

StudiousStudent

Guest
Hello all, I think the issue I'm having is that I'm able to get a couple of the permutations but not all of them.

string[] list1 = { "1", "2", "3" };
string[] list2 = { "4", "5", "6" };

I'm looking to concatinate and print out the strings:

1 + 4,

1 + 5,

1 + 6,

2 + 4,

2 + 5,

2 + 6,

3 + 4,

3 + 5,

3 + 6,

etc.

The order of thenumbers doesn't matter muh for example

1 + 4 is the same as 4 + 1 so I want to avoid printing out doubles too.

Also I was wondering if anyone could explaint to me an easy way to figure otu the number of permutations I would need to print for this question or any other. Thank you for your guidance.


StudiousStudent

Continue reading...
 
Back
Top