Skip to content

Instantly share code, notes, and snippets.

View enyim's full-sized avatar

Attila Kiskó enyim

  • EPAM
View GitHub Profile
@enyim
enyim / .block
Last active October 30, 2017 20:56
fresh block
license: mit

Keybase proof

I hereby claim:

  • I am enyim on github.
  • I am enyim (https://keybase.io/enyim) on keybase.
  • I have a public key ASCO6W9F53TiN5XFDlMGUBWagdRzB-w9wF1IY_5rYNQfUgo

To claim this, I am signing this object:

static IEnumerable<string> Permutate<T>(T[][] parts)
{
var counters = new int[parts.Length];
var max = parts.Aggregate(1, (a, p) => a * p.Length);
if (max < 0) throw new ArgumentOutOfRangeException("Underflow; too many parts");
var counterPos = parts.Length - 1;
var count = 0;
while (count < max)