add solution for hw4:3637
Some checks failed
Fast Reverse Tests / test (push) Successful in 15s
Reverse Tests / test (push) Successful in 9s
Sum Tests / test (push) Successful in 10s
Word Stat Tests / test (push) Failing after 7s

This commit is contained in:
2026-02-02 11:50:52 +05:00
parent 21d9d2c105
commit 868a206eb1

View File

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