add solution for hw4:3637
This commit is contained in:
@@ -28,7 +28,7 @@ public class WordStatLengthMiddle {
|
||||
if (sb.length() > 0) {
|
||||
String word = sb.toString().toLowerCase();
|
||||
if (word.length() >= 7) {
|
||||
word = word.substring(2, word.length() - 3);
|
||||
word = word.substring(3, word.length() - 3);
|
||||
if (wordMap.containsKey(word)) {
|
||||
wordMap.get(word).count++;
|
||||
} else {
|
||||
@@ -47,7 +47,7 @@ public class WordStatLengthMiddle {
|
||||
if (sb.length() > 0) {
|
||||
String word = sb.toString().toLowerCase();
|
||||
if (word.length() >= 7) {
|
||||
word = word.substring(2, word.length() - 3);
|
||||
word = word.substring(3, word.length() - 3);
|
||||
if (wordMap.containsKey(word)) {
|
||||
wordMap.get(word).count++;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user