Sha256: 4f463078dd684d5cdf2dc99557842d4517a52a42c2b58e191b96b5926c51d8cd
Contents?: true
Size: 542 Bytes
Versions: 82
Compression:
Stored size: 542 Bytes
Contents
exercise: Anagram version: 1 plan: 18 imports: '&match-anagrams' tests: | is match-anagrams(|.<subject candidates>), |.<expected description> for @($c-data<cases>); unit: module example: | sub match-anagrams ($word, @words) is export { my @results; my $canonical = canonize($word); for @words -> $w { next if $w.lc eq $word.lc; my $try = canonize($w); if $try eq $canonical { @results.push: $w; } } @results; } sub canonize ($str) { (($str.lc.split('')).sort).join(''); }
Version data entries
82 entries across 82 versions & 1 rubygems