Practice · 2 of 3
Unique words and their counts
CHALLENGE
Difficulty: beginner+25 XP
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.
Press Submit to check your solution.
Back to lesson: Practice: Practice: Collections at Work