in reply to Quick way to find the letter with the most occurences in a string
You have to count, unless you're OK with an approximation.
print chr(rand(3)+65);It's short, runs in constant time, and is right 1/3 of the time. :-)
|
---|
In Section
Seekers of Perl Wisdom