https://leetcode.com/problems/longest-common-prefix/#/description
class Solution(object):
def longestCommonPrefix(self, strs):
"""
:type strs: List[str]
:rtype: str
"""
if len(strs) == 0: return ""
minlen=len(strs[0])
for s in strs[1:]:
if minlen>len(s):
minlen=len(s)
for ind in xrange(minlen):
c=strs[0][ind]
match=1
for s in strs[1:]:
if s[ind]!=c:
match=0
break
if match==0:
minlen=ind
break
return strs[0][:minlen]