http://www.perlmonks.org?node_id=840732


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. :-)

  • Comment on Re: Quick way to find the letter with the most occurences in a string
  • Download Code