I just want to get cartesian product of numbers in a single list with specified number in C#. In below, I gave some examples of actually what I want get to:
List<int> numbers = new List<int>() { 0, 1, 2 };
There should be a function to get all cartesian product of that numbers with given number n.
For example, n=2 then the output should be like this:
0,0
0,1
0,2
1,0
1,1
1,2
2,0
2,1
2,2
Are there any suggestions or examples for this?