直接上代码: def longestCommonPrefix(strs): """ :type strs: List[str] :rtype: str """ str_list = strs if len(str_list) > 1: s_last = str_list.pop() common_str = '' common = '' for num, str_ in enumerate(str_list): if num is 0: i
题目 Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix,return an empty string "". Example1: Input:["flower","flow","flight"] Output:"fl"
Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: ["flower","flow","flight"] Output: "fl" Exa