Fix repeated permutations index advancement
This commit is contained in:
1 parent
f158e24247
commit
5228c9e6a2
2 files changed
+11
-1
No files matched your search
@@ -93,6 +93,16 @@ public class EnumerableExtensionsTest
|
||||
Assert.Equal([[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]], actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Permutations_repeated_123_3_counts_27()
|
||||
{
|
||||
int[] data = [1, 2, 3];
|
||||
|
||||
var actual = data.PermutationsWithRepeats(3).ToArray();
|
||||
|
||||
Assert.Equal(27, actual.Length);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Permutations_123_2_equals_12_13_21_23_31_32()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user