class Solution(object):
def longestCommonPrefix(self, strs):
"""
:type strs: List[str]
:rtype: str
"""
if len(strs)== 0: return ''
temp = strs[0]
for str in strs:
while str.find(temp) != 0:
temp = temp[:-1]
return temp
Leetcode14-最小前缀
猜你喜欢
转载自blog.csdn.net/qq_35180757/article/details/106794012
今日推荐
周排行