题目如下:
Python代码:
def longestCommonPrefix(self, strs): """ :type strs: List[str] :rtype: str """ if not strs: return ‘‘ for i,letter_group in enumerate(zip(*strs)): if len(set(letter_group))>1: return strs[0][:i] else: return min(strs)
时间: 2024-10-08 16:36:37