Skip to content

Commit 12f5dd1

Browse files
authored
Update README_EN.md
1 parent 12ce950 commit 12f5dd1

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

solution/0000-0099/0014.Longest Common Prefix/README_EN.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -252,22 +252,18 @@ end
252252

253253
#### C
254254

255-
```C
256-
257-
char *longestCommonPrefix(char **strs, int strsSize) {
258-
if (strsSize == 0)
259-
return "";
260-
for (int i = 0; strs[0][i]; i++) {
261-
for (int j = 1; j < strsSize; j++) {
262-
if (strs[j][i] != strs[0][i]) {
263-
strs[0][i] = '\0';
264-
return strs[0];
265-
}
255+
```c
256+
char* longestCommonPrefix(char** strs, int strsSize) {
257+
for (int i = 0; strs[0][i]; i++) {
258+
for (int j = 1; j < strsSize; j++) {
259+
if (strs[j][i] != strs[0][i]) {
260+
strs[0][i] = '\0';
261+
return strs[0];
262+
}
263+
}
266264
}
267-
}
268-
return strs[0];
265+
return strs[0];
269266
}
270-
271267
```
272268
273269
<!-- tabs:end -->

0 commit comments

Comments
 (0)