```
class Solution(object):
def longestCommonPrefix(self, strs):
"""
:type strs: List[str]
:rtype: str
"""
if len(strs) == 0:
return ""
minLen = len(strs[0])
for i in range(len(strs)):
minLen = min(len(strs[i]), minLen)
lcp = ""
i = 0
while i < minLen:
char = strs[0][i]
for j in xrange(1, len(strs)):
if strs[j][i] != char:
return lcp
lcp = lcp + char
i += 1
return lcp
```