Skip to content

Commit 7054a89

Browse files
Fix
Signed-off-by: begeekmyfriend <[email protected]>
1 parent 022a196 commit 7054a89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

030_substring_with_concatenation_of_all_words/concatenation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int *findSubstring(char *s, char **words, int wordsSize, int *returnSize)
118118
char *word = malloc(len + 1);
119119
word[len] = '\0';
120120
int *indexes = malloc(cap * sizeof(int));
121-
for (i = 0; s[i] != '\0'; i++) {
121+
for (i = 0; s[i + len - 1] != '\0'; i++) {
122122
memcpy(word, s + i, len);
123123
indexes[i] = find(word, heads, hash_size);
124124
}

0 commit comments

Comments
 (0)