#
# 
# @param strs string字符串一维数组 
# @return string字符串
#
class Solution:
    def longestCommonPrefix(self , strs ):
        # write code here
        if len(strs) == 0:
            return ""
        l = ""
        m = strs[0]
        for index in range(len(m)):
            num = 1
            for i in strs[1:]:
                if index < len(i):
                    if m[index] == i[index]:
                        num += 1
            if num == len(strs):
                l += m[index]
            if num < len(strs):

                break

        return l