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

This commit is contained in:
2026-01-31 15:54:01 +05:00
parent e197eb2690
commit 5945b021f2

View File

@@ -28,7 +28,7 @@ public class WordStatLengthSuffix {
if (sb.length() > 0) {
String word = sb.toString().toLowerCase();
if (word.length() != 1) {
word = word.substring(word.length() / 2);
word = word.substring(word.length() - word.length() / 2);
if (wordMap.containsKey(word)) {
wordMap.get(word).count++;
} else {
@@ -47,7 +47,7 @@ public class WordStatLengthSuffix {
if (sb.length() > 0) {
String word = sb.toString().toLowerCase();
if (word.length() != 1) {
word = word.substring(word.length() / 2);
word = word.substring(word.length() - word.length() / 2);
if (wordMap.containsKey(word)) {
wordMap.get(word).count++;
} else {