You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usingMoreLinq;varsources=fromcountinMoreEnumerable.Generate(1, x =>x+1)select(count,Enumerable.Range(1,count));foreach(var(count,source)insources)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
The text was updated successfully, but these errors were encountered:
Code to reproduce:
Results for first 26:
Results for Permutations(13) and onward produce incorrect results.
Discussed in #977
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
The text was updated successfully, but these errors were encountered: