|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Re: Quick way to find the letter with the most occurences in a stringby wanna_code_perl (Monk) |
| on May 19, 2010 at 16:43 UTC ( #840732=note: print w/ replies, xml ) | Need Help?? |
|
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
|
|
||||||||||||||||||||