Skip to main content

Practice ยท 2 of 3

Unique words and their counts

Implement static int distinctWords(String sentence) (whitespace-split, case-insensitive) and static java.util.Map<String, Integer> wordCounts(String sentence) mapping each lowercase word to its count.

Difficulty: beginner

Back to lesson: Practice: Practice: Collections at Work