Skip to content

Commit 80e1d29

Browse files
author
Filip Sergot
committed
masak++ \'s combinations solution.
1 parent 7f7a7c5 commit 80e1d29

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

other/combinations.pl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
use v6;
2+
3+
multi combs(@, 0) { "" };
4+
multi combs { combs(@^dict, $^n - 1) X~ @dict };
5+
6+
(.say for combs(<a b c>, $_)) for 1..4;

0 commit comments

Comments
 (0)