in reply to Re: Golf for unique digitsin thread Golf for unique digits
perl -nlE"say 0+s/(.)(?!.*\1)//g"
This seems to work just as well?
perl -nlE"say s/(.)(?!.*\1)//g"
tye++ ... but I'm stuck to understand how it works?
According to perlop:
Searches a string for a pattern, and if found, replaces that pattern with the replacement text and returns the number of substitutions made.
How does the number of substitutions made equate to the number of characters left after the substitutions?
(?!..) = not followed by!
every cipher is exactly once the last of it's kind! =)
Of course! Thanks.
A subterranean mammal
A skin blemish
A sprained ankle
A Childrens Book
The Marvel Comics supervillain
The unit of measure
Wie is de Mol
A futuristic drilling vehicle
The Wind in The Willows
Results (259 votes). Check out past polls.