
Description
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 “”.
My Solution
Python
1 |
class (object): |
Best Solution
Python
1 |
def longestCommonPrefix(self, strs): |
- min(list, key=function): 返回key参数中函数返回的值中最小值所对应的list参数中的值。min([‘I’,‘love’,‘you’], key=len)返回值为‘I’




近期评论