MoreLINQ
MoreLINQ copied to clipboard
All possible combinations of N size
I actually downloaded morelinq for this, but found it did not include this.
Solution and example: https://stackoverflow.com/questions/33336540/how-to-use-linq-to-find-all-combinations-of-n-items-from-a-set-of-numbers
Best would be to nudge user109260 on stackoverflow.com to contribute here with tests.
It would be useful to do this for permutations. Perhaps the methods are Combine
and Permute
with any overloads.
@atifaziz Is this issue dead? I actually implemented this and a version with permutations only by hand and would gladly switch to a solid MoreLINQ implementation, or contribute my implementation here, but it seems there is a PR already only that it's stale.
@V0ldek If you're talking about PR #647, it's not stale. It's blocked on bug fix for #645 that won't ship until the next major version where we can afford breaking changes. That said, there's nothing stopping from making the fix internal that later exposed through Subsets(0)
.