class Solution(object):
    def longestCommonPrefix(self, strs):
        res = []
        i = 0
        while True:
            try:
                tmp = strs[0][i]
                for str in strs[1:]:
                    if str[i] != tmp:return "".join(res)
                res.append(tmp)
                i+=1
            except Exception:return "".join(res)
        return "".join(res)

ae70934cf8d1976206e1170a7c4c80581108b2a4
<mask token>

class Solution(object):
    <mask token>

class Solution(object):

    def longestCommonPrefix(self, strs):
        res = []
        i = 0
        while True:
            try:
                tmp = strs[0][i]
                for str in strs[1:]:
                    if str[i] != tmp:
                        return ''.join(res)
                res.append(tmp)
                i += 1
            except Exception:
                return ''.join(res)
        return ''.join(res)

class Solution(object):
    def longestCommonPrefix(self, strs):
        res = []
        i = 0
        while True:
            try:
                tmp = strs[0][i]
                for str in strs[1:]:
                    if str[i] != tmp:return "".join(res)
                res.append(tmp)
                i+=1
            except Exception:return "".join(res)
        return "".join(res)
