The program must output the letter that is paired the most. For example, if your program was given the following string:
"Sally's friend Bobby searched for seashells."
it must output L
because "ll"
occurs twice, which is more frequent than the other pair "bb"
.
Rules:
- If more than one letter has 1st place for occurrences, then output all of them in alphabetical order (e.g.
"Sally's friends Jimmy and Bobby rummaged for seashells."
should output bothL
ANDM
[or"LM"
if you please] because they both occur more frequently than other pairs.) - Letters which are tripled, quadrupled, etc. count as one pair (e.g.
"lll"
in"willless"
is counted as only one pair ofL
.) - Letter pairs must be in one word (e.g.
"Sally's sociable friends Sammy and Bobby searched for fabulous seashells."
should outputL
and notS
because despite"ss"
having more occurrences than"ll"
, they are separated by spaces.) - Count only letters from the English alphabet
- Case does not matter (e.g.
"Ss"
is the same as"SS"
or"ss"
, and all are counted as one pair ofS
.)
You may read your input from wherever you please. Shortest code wins.
'
etc? \$\endgroup\$['l']
? \$\endgroup\$