using MoreLinq;
var sources =
from count in MoreEnumerable.Generate(1, x => x + 1)
select (count, Enumerable.Range(1, count));
foreach (var (count, source) in sources)
Console.WriteLine($"Permutations({count:N0}) = {source.Permutations().Count():N0}");
Originally posted by **laurinpaech** March 1, 2023
Hi! I was trying to loop over the permutations of a list of objects. The objects are of a custom type, not builtin. It does work but only generates a single permutation and therefore iterates once and then stops. Do they need to implement some function for it to work? I couldn't find anything in the documentation. The same code works when using ints
Code to reproduce:
Results for first 26:
Results for Permutations(13) and onward produce incorrect results.
Discussed in https://github.com/morelinq/MoreLINQ/discussions/977