Permutations with some identical elements: Difference between revisions
Permutations with some identical elements (view source)
Revision as of 14:38, 6 April 2022
, 2 years ago→{{header|Wren}}: Now uses Wren-perm module.
m (→{{header|Phix}}: syntax coloured, use of new builtin) |
(→{{header|Wren}}: Now uses Wren-perm module.) |
||
Line 1,370:
=={{header|Wren}}==
{{
<lang ecmascript>
var createList = Fn.new { |nums, charSet|
Line 1,410 ⟶ 1,381:
}
var nums = [2, 1]
var
System.print(Perm.listDistinct(a).map { |p| p.join() }.toList)
System.print()
nums = [2, 3, 1]
System.print(Perm.listDistinct(a).map { |p| p.join() }.toList)
System.print()
System.print(Perm.listDistinct(a).map { |p| p.join() }.toList)</lang>
▲s = createList.call(nums, "ABC")
{{out}}
|