Hmm, this doesn't beat tye's, but matches it, with a different technique. I wish I could find a way to shave a stroke using this method, but I think I've reached the dead end.
perl -lnE'@h{/./g}--;say~~keys%h'
And this adaptation of tye's shaves a stroke:
perl -lnE'say~~s/(.)(?!.*\1)//g'
Dave
In reply to Re: Golf for unique digits
by davido
in thread Golf for unique digits
by Cody Fendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |