This commit is contained in:
2026-01-23 11:58:36 +03:00
parent e30a84f178
commit c1669b7814

View File

@@ -11,7 +11,6 @@ public class WordGroupImpl implements WordGroup {
public Map<Integer, List<String>> groupWordsByLength(String text) { public Map<Integer, List<String>> groupWordsByLength(String text) {
text = text.replaceAll("[.,]", ""); text = text.replaceAll("[.,]", "");
return Arrays.stream(text.split(" ")) return Arrays.stream(text.split(" "))
.map(String::toLowerCase)
.collect(Collectors.groupingBy(String::length)); .collect(Collectors.groupingBy(String::length));
} }
} }