Permutations: Difference between revisions

Content deleted Content added
Add explicit solution in Smalltalk
Line 5,295: Line 5,295:
[:g |
[:g |
c map permuteAndDo: [g yield: (c copyFrom: 1 to: c size)]]]
c map permuteAndDo: [g yield: (c copyFrom: 1 to: c size)]]]
</lang>

Use example:
<lang Smalltalk>
st> 'Abc' permutations contents
('bcA' 'cbA' 'cAb' 'Acb' 'bAc' 'Abc' )
</lang>
</lang>