# longest common prefix
# https://leetcode.com/problems/longest-common-prefix/

strs = ["flower","flow","flight"]
res = ""
stop = False
for i in range(len(strs[0])):
    c = strs[0][i]
    for j in range(len(strs)):
        if i >= len(strs[j]) or c != strs[j][i]:
            stop = True
            break
    if not stop:
        res += c
    else:
        break
    
print (res)

0dd9eaa337c549de31b54dc7a8a226a51755e97d
<mask token>

<mask token>
for i in range(len(strs[0])):
    c = strs[0][i]
    for j in range(len(strs)):
        if i >= len(strs[j]) or c != strs[j][i]:
            stop = True
            break
    if not stop:
        res += c
    else:
        break
print(res)

strs = ['flower', 'flow', 'flight']
res = ''
stop = False
for i in range(len(strs[0])):
    c = strs[0][i]
    for j in range(len(strs)):
        if i >= len(strs[j]) or c != strs[j][i]:
            stop = True
            break
    if not stop:
        res += c
    else:
        break
print(res)

# longest common prefix
# https://leetcode.com/problems/longest-common-prefix/

strs = ["flower","flow","flight"]
res = ""
stop = False
for i in range(len(strs[0])):
    c = strs[0][i]
    for j in range(len(strs)):
        if i >= len(strs[j]) or c != strs[j][i]:
            stop = True
            break
    if not stop:
        res += c
    else:
        break
    
print (res)
