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
"ll" occurs twice, which is more frequent than the other pair
- 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 both
"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.
"willless"is counted as only one pair of
- Letter pairs must be in one word (e.g.
"Sally's sociable friends Sammy and Bobby searched for fabulous seashells."should output
"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", and all are counted as one pair of
You may read your input from wherever you please. Shortest code wins.