Skip to main content

Practice ยท 1 of 3

Frequency Map & Grouping

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).

Difficulty: intermediate

Back to lesson: Practice: Functional Lab