Retired
Character frequency (retired)
1,424 of 2,571Svenito
Description:
Write a function that takes a piece of text in the form of a string and returns the letter frequency count for the text. This count excludes numbers, spaces and all punctuation marks. Upper and lower case versions of a character are equivalent and the result should all be in lowercase.
The function should return a list of tuples (in Python and Haskell) or arrays (in other languages) sorted by the most frequent letters first. The Rust implementation should return an ordered BTreeMap. Letters with the same frequency are ordered alphabetically. For example:
letter_frequency('aaAabb dddDD hhcc')
will return
[('d',5), ('a',4), ('b',2), ('c',2), ('h',2)]
Letter frequency analysis is often used to analyse simple substitution cipher texts like those created by the Caesar cipher.
Strings
Algorithms
Similar Kata:
Stats:
Created | Aug 11, 2014 |
Warriors Trained | 5310 |
Total Skips | 675 |
Total Code Submissions | 17277 |
Total Times Completed | 2571 |
Python Completions | 1424 |
JavaScript Completions | 586 |
Ruby Completions | 194 |
Rust Completions | 294 |
C++ Completions | 99 |
Haskell Completions | 40 |
Total Stars | 130 |
% of votes with a positive feedback rating | 94% of 455 |
Total "Very Satisfied" Votes | 403 |
Total "Somewhat Satisfied" Votes | 45 |
Total "Not Satisfied" Votes | 7 |