diff options
| -rw-r--r-- | challenge-081/simon-proctor/raku/ch-1.raku | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-081/simon-proctor/raku/ch-1.raku b/challenge-081/simon-proctor/raku/ch-1.raku new file mode 100644 index 0000000000..951677af6e --- /dev/null +++ b/challenge-081/simon-proctor/raku/ch-1.raku @@ -0,0 +1,13 @@ +#!/usr/bin/env raku + +use v6; + +#| Given two strings find the common root strings +sub MAIN ( Str $a, Str $b ) { + .say for ( get-roots($a) (&) get-roots($b) ).keys; +} + +sub get-roots( Str $a ) { + ($a ~~ m:ex/^ (.+?) $0* $/).map(*[0].Str); +} + |
