public static IEnumerable<IEnumerable<TValue>> Combination<TValue>(
this IEnumerable<TValue> values,
Int32 count,
Int32 num)
{
var t = Enumerable.Range(0, num).ToList();
do
{
yield return values.Where((x, i) => t.Contains(i));
}
while (NextCombination(t, count, num));
}
public static bool NextCombination(List<int> ar,&
c#组合算法
最新推荐文章于 2025-05-12 13:27:53 发布