Logic problem with lists C#

i wanted to make gameobject list or array with all possible combination of enemies for example i have 3 enemies a, b and c and list should look like this:
I tried to make this by list of custom class or multidimensional array but it doesn’t work (I don’t know how many enemies are there)

List of Lists would work, and multi-dimension arrays would work too.

GameObject [][] referencesArray;
referencesArray[0][0] = obj;
for (int i = 0 ; i < referencesArray.Length ; i++)
    for (int g = 0 ; g < referencesArray*.Length ; g++)*

Debug.Log (g.name);
List<List> referencesList = new List<List>();
referencesList.Add (new List());
referencesList[0].Add (obj);
foreach (List l in referencesList)
foreach (GameObject g in l)
Debug.Log (g.name);
When you say it doesn’t work, do you mean you can’t assign them in the editor?

What you are describing is a ‘combination’

“Alice, Bob and Charlie is the same as Charlie, Bob and Alice. Permutations are for lists (order matters) and combinations are for groups (order doesn’t matter). A joke: A “combination lock” should really be called a “permutation lock”. The order you put the numbers in matters.”

There are specific algorithms to create a list that is a combination of a set of elements (web search it). You can’t do it with a simple loop; essentially you either need to loop over an array of indexes into a list or a recursive function. Challenging stuff, if you’re not an expert.