Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def longestCommonPrefix(self, strs: List[str]) -> str:
- res = ""
- for i in range(len(strs[0])):
- for s in strs:
- if i==len(s) or s[i]!= strs[0][i]:
- return res
- res += strs[0][i]
- return res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement