Skip to content

Commit 13e697b

Browse files
committed
Time: 1 ms (50.81%) | Memory: 43.3 MB (62.94%) - LeetSync
1 parent 3ce4755 commit 13e697b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ public int countPrefixes(String[] words, String s) {
44
int count=0;
55
StringBuilder sb = new StringBuilder(s);
66
for(String word : words){
7-
int temp = s.indexOf(word);
8-
if(temp==0){
7+
if(s.indexOf(word)==0){
98
count++;
109
}
1110
}

0 commit comments

Comments
 (0)