def longestCommonPrefix(self, strs):
        """
        O(k*n)
        :param strs: a list of string
        :return: string, prefix
        """
        # checking, otherwise: ValueError: min() arg is an empty sequence
        if not strs:
            return ""

        n = len(strs)

        str_builder = ""
        min_len = min(len(string) for string in strs)
        for i in range(min_len):
            char = strs[0][i]

            j = 0
            while j<n:
                try:
                    if strs[j][i]!=char: break
                    j += 1
                except __HOLE__:
                    break

            if j==n:
                str_builder += char
            else:
                break

        return str_builder
dataset/ETHPy150Open algorhythms/LeetCode/015 Longest Common Prefix.py/Solution.longestCommonPrefix