class Solution:
	# @param A : list of strings
	# @return a strings
    def longestCommonPrefix(self, A):
        length = len(A)
        res = A[0]
        for index in range(1,length):
            i = 0
            j = 0
            while i< len(res) and j < len(A[index]) and res[i] == A[index][j]:
                i +=1
                j +=1
            res = A[index][0:j]
        return res

if __name__ == '__main__':
    print(Solution.longestCommonPrefix(Solution,
                                       # ["abcdefgh", "aefghijk", "abcefgh"]))
                                       # ["abab", "ab", "abcd"]))
                                       ["abcd", "abcd", "efgh"]))
5a2a38886c554b625cc1a3329073b574c0810dc5
<mask token>

class Solution:
    <mask token>


<mask token>

class Solution:

    def longestCommonPrefix(self, A):
        length = len(A)
        res = A[0]
        for index in range(1, length):
            i = 0
            j = 0
            while i < len(res) and j < len(A[index]) and res[i] == A[index][j]:
                i += 1
                j += 1
            res = A[index][0:j]
        return res


<mask token>

class Solution:

    def longestCommonPrefix(self, A):
        length = len(A)
        res = A[0]
        for index in range(1, length):
            i = 0
            j = 0
            while i < len(res) and j < len(A[index]) and res[i] == A[index][j]:
                i += 1
                j += 1
            res = A[index][0:j]
        return res


if __name__ == '__main__':
    print(Solution.longestCommonPrefix(Solution, ['abcd', 'abcd', 'efgh']))

class Solution:
	# @param A : list of strings
	# @return a strings
    def longestCommonPrefix(self, A):
        length = len(A)
        res = A[0]
        for index in range(1,length):
            i = 0
            j = 0
            while i< len(res) and j < len(A[index]) and res[i] == A[index][j]:
                i +=1
                j +=1
            res = A[index][0:j]
        return res

if __name__ == '__main__':
    print(Solution.longestCommonPrefix(Solution,
                                       # ["abcdefgh", "aefghijk", "abcefgh"]))
                                       # ["abab", "ab", "abcd"]))
                                       ["abcd", "abcd", "efgh"]))