Skip to content

Commit 7054a89

Browse files
Fix
Signed-off-by: begeekmyfriend <begeekmyfriend@gmail.com>
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy