Practice · 1 of 3
Frequency Map & Grouping
CHALLENGE
Difficulty: intermediate+25 XP
Given List<String> words, implement with Collectors (no explicit
loops):
- static Map<String, Long> frequencies(List<String> words) — each
distinct word → how many times it appears (case-SENSITIVE keys).
- static Map<Integer, List<String>> byLength(List<String> words) —
group words by their length.
- static Map<Boolean, List<String>> longWords(List<String> words) —
partition into length > 4 (true) vs rest (false).
Press Submit to check your solution.
Back to lesson: Practice: Functional Lab