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
Press Submit to check your solution.
Back to lesson: Practice: Practice: Collections at Work