diff options
| -rw-r--r-- | challenge-335/wambash/raku/ch-1.raku | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/challenge-335/wambash/raku/ch-1.raku b/challenge-335/wambash/raku/ch-1.raku new file mode 100644 index 0000000000..0ce592bda5 --- /dev/null +++ b/challenge-335/wambash/raku/ch-1.raku @@ -0,0 +1,23 @@ +#!/usr/bin/env raku + +sub common-charakters (+words) { + words + andthen .map: *.comb.Bag + andthen [∩] $_ + andthen .kxxv + andthen .sort +} + +multi MAIN (Bool :test($)!) { + use Test; + is common-charakters(<bella label roller>), <e l l>; + is common-charakters(<cool lock cook>), <c o>; + is common-charakters('hello', 'world', 'pole'), <l o>; + is common-charakters('abc', 'def', 'ghi'), Empty; + is common-charakters('aab', 'aac', 'aaa'), <a a>; + done-testing; +} + +multi MAIN (+words) { + put common-charakters words; +} |
