❤leetcode,python2❤编写一个函数来查找字符串数组中的最长公共前缀。 若是不存在公共前缀,返回空字符串 “”。

class Solution(object): def longestCommonPrefix(self, strs): """ :type strs: List[str] :rtype: str """ rstr = '' if strs == []: return rstr old = strs[
相关文章
相关标签/搜索