Sha256: 123bc0eb0f22b61141e50a93a3170f6b311027d75589554438a3661679729d3d
Contents?: true
Size: 437 Bytes
Versions: 75
Compression:
Stored size: 437 Bytes
Contents
class Anagram is export { method match ($word, @words) { my @results; my $canonical = self!canonize($word); for @words -> $w { next if $w.lc eq $word.lc; my $try = self!canonize($w); if $try eq $canonical { @results.push: $w; } } @results; } method !canonize($str) { (($str.lc.split('')).sort).join(''); } }
Version data entries
75 entries across 75 versions & 1 rubygems