Write a function to find the longest common prefix string amongst an array of strings.
class Solution:
# @return a string
def longestCommonPrefix(self, strs):
minLength = 99999
shortest = ''
for i in strs:
if len(i) < minLength : minLength = len(i); shortest = i
prefix = ''
for i in range(0,len(shortest)):
char = shortest[i]
for j in range(0,len(strs)):
if strs[j][i] != char : return prefix
prefix += char
return prefix