I have a list of N players (let's say, 14 players - 1 to 14 numbers in the examples).
I want to obtain a Collection of ALL possible TUPLE of Y teams made by X players. There can be players left out, of course.
Input example: N = 14 players, Y = 3 teams, each composed by X = 3 players. That means 14 players, split into 3 teams of 3 players. I want all the possibilities.
1) [123],[456],[789] 10,11,12,13,14 left out.
2) [456],[789],[10,11,12] 1,2,3,13,14 left out. 3) ....
I already looked into this post, which helped me to obtain all possible teams of X players, which i think might help me to reach my goal: What is the best way to find all combinations of items in an array? Now that i have all possible teams of X players, i need to get a step further. When i'll have all the possible tuple of teams, i will select which combination best suits my needs sorting them. Can you guys help me? C# code would be great but even pseudocode can help.