in reply to Re: Quick way to find the letter with the most occurences in a string
in thread Quick way to find the letter with the most occurences in a string
my %count; $count{$_}++ foreach split //,$string; my $max = (sort {$a<=>$b} values %count)[-1]; print $max,' ',grep $count{$_} == $max,keys %count;
|
|---|