Sha256: 46195dca5992e0fb6f78097903e3ab821a486749ef94d15585d00cdff19f2a83
Contents?: true
Size: 347 Bytes
Versions: 156
Compression:
Stored size: 347 Bytes
Contents
unit module Anagram:ver<1>; 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
156 entries across 156 versions & 1 rubygems