Write a function to find the longest common prefix string amongst an array of strings.
求所有的字符串的最长公共前缀~直接用brute force的解法~
class Solution:
# @return a string
def longestCommonPrefix(self, strs):
if strs is None or len(strs) == 0: return ""
res = ""
for i in xrange(len(strs[0])):
for string in strs:
if i > len(string) - 1 or strs[0][i] != string[i]:
return res
res += strs[0][i]
return res