Skip to content

Commit 1f0b821

Browse files
committed
Time: 0 ms (100.00%) | Memory: 43.5 MB (37.49%) - LeetSync
1 parent edc8e58 commit 1f0b821

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

2341-count-prefixes-of-a-given-string/count-prefixes-of-a-given-string.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ class Solution {
22
public int countPrefixes(String[] words, String s) {
33

44
int count=0;
5-
StringBuilder sb = new StringBuilder(s);
5+
// StringBuilder sb = new StringBuilder(s);
66
for(String word : words){
7-
if(s.indexOf(word)==0){
7+
if(s.startsWith(word)){
88
count++;
99
}
1010
}

0 commit comments

Comments
 (0)