Just throwing this one out there for fun and to show a different approach:
#!/usr/bin/perl -nla INIT{undef$/};$w{$_}++for@F;print"$_ ($w{$_})"for keys%w;print"".@F # 345678 1 2345678 2 2345678 3 2345678 4 2345678 5 2345678 6 234567
67 + 4 = 71 strokes
In reply to Re: Golf: Count unique words
by !1
in thread Golf: Count unique words
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |