add solution for hw4:3435
Some checks failed
Fast Reverse Tests / test (push) Successful in 12s
Reverse Tests / test (push) Successful in 7s
Sum Tests / test (push) Successful in 7s
Word Stat Tests / test (push) Failing after 5s

This commit is contained in:
2026-01-31 15:47:25 +05:00
parent 6c42ebab03
commit 7b3f22216f

View File

@@ -43,6 +43,21 @@ public class WordStatLengthSuffix {
data = r.read(); data = r.read();
} }
if (sb.length() > 0) {
String word = sb.toString().toLowerCase();
if (word.length() != 1) {
word = word.substring(word.length() / 2);
if (wordMap.containsKey(word)) {
wordMap.get(word).count++;
} else {
wordMap.put(word, new WordInfo(word, 1, wordIndex));
wordIndex++;
}
}
}
if (sb.length() > 0) { if (sb.length() > 0) {
String word = sb.toString().toLowerCase(); String word = sb.toString().toLowerCase();
if (wordMap.containsKey(word)) { if (wordMap.containsKey(word)) {