diff options
| author | Mohammad Sajid Anwar <Mohammad.Anwar@yahoo.com> | 2025-08-25 01:48:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-25 01:48:39 +0100 |
| commit | 3fe80370a8533122c1ea88a389f345f77f607631 (patch) | |
| tree | b5ecabc5c3422c1b169d3cff351f8dc8d3b8c542 | |
| parent | 38ee4fc3ae489264dbacb37b2799c49e7593e3ed (diff) | |
| parent | 1cbaef12f820f06395fec90354a691a91bfaac01 (diff) | |
| download | perlweeklychallenge-club-3fe80370a8533122c1ea88a389f345f77f607631.tar.gz perlweeklychallenge-club-3fe80370a8533122c1ea88a389f345f77f607631.tar.bz2 perlweeklychallenge-club-3fe80370a8533122c1ea88a389f345f77f607631.zip | |
Merge pull request #12565 from wambash/challenge-week-335
solution week 335-1
| -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; +} |
