Quick actions

cmd+k|ctrl+k

Navigation

Languages

Challenge 64 #2

Snippet info

Language

Raku

Visibility

public

Author

fernando-correa

Created

2020-06-09T00:40:45Z

Updated

2020-06-09T00:40:45Z

sub find(Str $str, @words) {
    @words.grep(-> $word {
        $str.contains($word)
    }) || 0
}

say find
    "perlweeklychallenge",
    <
        weekly
        challenge
        perl
    >
;
say find
    "perlandraku",
    <
        python
        ruby
        haskell
    >
;
INFO