I have looked hours for a solution without any success. Hopefully someone can help me out.
I have a dynamic array of N items on M origin zip codes.
For insta
What you're looking to do is generate combinations of each item in the array.
Here's an example hard-coded for N == 3:
var array1 = new[] { 1101, 5410, 60621 };
var array2 = new[] { 1101, 60621 };
var array3 = new[] { 60621 };
foreach (var a in array1)
{
foreach (var b in array2)
{
foreach (var c in array3)
{
Console.WriteLine("{0},{1},{2}", a, b, c);
}
}
}
See if you can adapt that for N cases.