算两个集合共有多少种配合


public static bool Do(List goodsSkuInfos, List> param)
{
if (param == null) { return false; }
List> LO = new List>();
int sum = 1;
int n = 0;
foreach (List o in param)
{
LO.Add(o);
sum *= o.Count;
n++;
};
for (int i = 0; i < sum; i++)
{
List _o = new List();
for (int j = 0; j < n; j++)
{
List o = LO[j];
_o.Add(o[(i * Index(LO, j) / sum) % o.Count]) ;
}
var skuinfo = goodsSkuInfos.Where(x => x.GoodsAttributeList == _o);
}
return true;
}

private static int Index(List> LO, int lindex)
{
int n = 1;
for (int i = 0; i < LO.Count; i++)
{
if (i <= lindex)
{
n = n * LO[i].Count;
}
else
{
break;
}
}
return n;
}