From 8173cf4dab17e9247dcf140b0275999fedebe8ff Mon Sep 17 00:00:00 2001 From: me Date: Sat, 31 Jan 2026 15:39:59 +0500 Subject: [PATCH] add solution for hw4:3435 --- java/wordStat/WordStatLengthSuffix.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/wordStat/WordStatLengthSuffix.java b/java/wordStat/WordStatLengthSuffix.java index c9c5291..de59fdc 100644 --- a/java/wordStat/WordStatLengthSuffix.java +++ b/java/wordStat/WordStatLengthSuffix.java @@ -59,8 +59,8 @@ public class WordStatLengthSuffix { PrintWriter writer = new PrintWriter(outputFileName, "UTF-8"); for (WordInfo info : sortedWords) { - if (info.word.length != 1) { - writer.println(info.word.substring(info.word.length / 2) + " " + info.count); + if (info.word.length() != 1) { + writer.println(info.word.substring(info.word.length() / 2) + " " + info.count); } }