Problem 60237. Finding the Most Frequent Letter in a Text
You are given a text containing various English letters, digits and punctuation symbols. Your task is to find the most frequently occurring letter in the tex.
The letter returned must be in lower case.
Rules:
- While checking for the most wanted letter, casing does not matter; therefore, 'A' is equivalent to 'a'.
- If two or more letters have the same frequency, return the letter that comes first in the Latin alphabet. For instance, in the word 'one', the letters 'o', 'n' and 'e' occur once each. Therefore, 'e' is chosen as it comes last in the Latin alphabet.
- Ignore punctuation symbols, digits, and whitespaces.
Example: in the text 'Hello World!', the most frequent letter is 'l'.
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers11
Suggested Problems
-
Find state names that end with the letter A
1174 Solvers
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1805 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
3141 Solvers
-
Lychrel Number Test (Inspired by Project Euler Problem 55)
97 Solvers
-
Numbers spiral diagonals (Part 2)
144 Solvers
More from this Author53
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!