Skip to content

Commit 90e7b25

Browse files
authored
Update Solution.java
1 parent 7981269 commit 90e7b25

File tree

1 file changed

+0
-6
lines changed
  • src/main/java/g2101_2200/s2135_count_words_obtained_after_adding_a_letter

1 file changed

+0
-6
lines changed

src/main/java/g2101_2200/s2135_count_words_obtained_after_adding_a_letter/Solution.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ private int getBitMap(String word) {
2525
int result = 0;
2626
for (int i = 0; i < word.length(); i++) {
2727
int position = word.charAt(i) - 'a';
28-
2928
result |= (1 << position);
3029
}
31-
3230
return result;
3331
}
3432

@@ -48,11 +46,9 @@ public int wordCount(String[] startWords, String[] targetWords) {
4846
if (startWords == null || startWords.length == 0) {
4947
return 0;
5048
}
51-
5249
if (targetWords == null || targetWords.length == 0) {
5350
return 0;
5451
}
55-
5652
preprocess(startWords);
5753
int count = 0;
5854
for (String word : targetWords) {
@@ -62,14 +58,12 @@ public int wordCount(String[] startWords, String[] targetWords) {
6258
if (i > 0) {
6359
bitMap = addBit(bitMap, word.charAt(i - 1));
6460
}
65-
6661
if (matches(bitMap)) {
6762
count++;
6863
break;
6964
}
7065
}
7166
}
72-
7367
return count;
7468
}
7569
}

0 commit comments

Comments
 (0)