add solution for hw4:3435
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user