in reply to Re: testing number of occurrences in a word
in thread testing number of occurrences in a word
49, but then again I suck at golf.
sub isogram { #234567890#234567890#234567890#234567890#234567890 my%h=map{($_,1)}split//,$_[0];keys%h==length$_[0] } print "$_ is ", (isogram($_) ? '' : 'not '), "an isogram\n" for @ARGV;
Duh, johngg had the right idea, except he wasn't greedy enough (nor was I. What's with the $_[0]? Sheesh.):
sub isogram { #23456789 /(.).*\1/ } print "$_ is ", (isogram() ? '' : 'not '), "an isogram\n" for @ARGV;
That makes for 9.
• another intruder with the mooring in the heart of the Perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: testing number of occurrences in a word
by liverpole (Monsignor) on Sep 19, 2006 at 16:58 UTC |