#197 Letter Frequency Dictionary
Build a frequency dictionary for letters of the Russian or English alphabet. The problem of selecting and analyzing a language corpus can be omitted; a short text is sufficient.
public class Main {
/**
* Example:
* Input text: Build a frequency dictionary of letters in the Russian (or English) alphabet.
* Result:
* a 5
* b 2
* c 2
* d 2
* e 7
* f 2
* g 1
* h 3
* i 6
* l 4
* n 5
* o 3
* p 1
* q 1
* r 5
* s 4
* t 5
* u 3
* y 2
*
* @param text - input text
* @return an associative array of character frequencies
*/
public Map<Character, Integer> buildDictionaryWithMap(String text) {
throw new UnsupportedOperationException("Implemented it!");
}
public static void main(String... args) {
}
}
Question review
Sign in to start the dialogue
The mentor keeps the context of the current question and your previous messages.
Sign in
Available with Premium
This is just one of the solutions available with Premium. And more:
- 250+ advanced lectures
- 1300+ practice exercises
- 500+ solutions to problems from real interviews
- Personalized Java Hub certificates
- Expanded access to the AI mentor