6
Reply

Get permutations of array numbers

Pavel

Pavel

Oct 4 2016 7:17 AM
227

Hello,

Here below is a list molex_stubs of int arrays.

How to create a list of all permutation of array members where:

  • list items are arrays of int
  • item length is 14 (number of items in molex_stubs list
  • 0-items of int arrays come from molex_stubs[0], 1st-item of int arrays come from molex_stubs[1], etc.

Thanks

  1. List<int[]> molex_stubs = new List<int[]>()  
  2. {  
  3.     new int[] { 3, 1, -1, -3 },  
  4.     new int[] { 3, 1, -1, -2 },   
  5.     new int[] { 0 },  
  6.     new int[] { 4, 3, 1, -1, -3, -4 },  
  7.     new int[] { 2, 1, -1, -3 },  
  8.     new int[] { 0, -3 },  
  9.     new int[] { 3, 0 },  
  10.   
  11.     new int[] { 3, 1, -1, -3 },  
  12.     new int[] { 4, 3, 1, -1, -3, -4 },  
  13.     new int[] { 3, 0 },  
  14.     new int[] { 2, 1, -1, -3 },  
  15.     new int[] { 0 },  
  16.     new int[] { 0, -3 },  
  17.     new int[] { 3, 1, -1, -2 }  
  18. };  

Answers (6)