Skip to content

Commit cecba66

Browse files
committed
Merge pull request #8 from srv89/patch-1
Update longest-common-prefix.py
2 parents 8c2185d + a99f76a commit cecba66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/longest-common-prefix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def longestCommonPrefix(self, strs):
1414
return ""
1515

1616
for i in xrange(len(strs[0])):
17-
for string in strs:
17+
for string in strs[1:]:
1818
if i >= len(string) or string[i] != strs[0][i]:
1919
return strs[0][:i]
2020
return strs[0]

0 commit comments

Comments
 (0)