Permutations by swapping: Difference between revisions
Full test
(Better format) |
(Full test) |
||
Line 2,366:
generate $array $array.Count ([ref]1)
}
permutation @(0, 1, 2
""
permutation @(0, 1, 2, 3)
</lang>
<b>Output:</b>
<pre>
Perm: [0, 1, 2] Sign: 1
Perm: [1, 0, 2] Sign: -1
Perm: [2, 0, 1] Sign: 1
Perm: [0, 2, 1] Sign: -1
Perm: [1, 2, 0] Sign: 1
Perm: [2, 1, 0] Sign: -1
Perm: [0, 1, 2, 3] Sign: 1
Line 2,416 ⟶ 2,431:
Perm: [1, 0, 3, 2] Sign: 1
Perm: [0, 1, 3, 2] Sign: -1
</pre>
|