10. Longest Common Prefix
Write a function that finds the longest common prefix among an array of strings.
範例 1:
輸入: strs = ["flower","flow","flight"] 輸出: fl
範例 2:
輸入: strs = ["dog","racecar","car"] 輸出:
限制條件:
1 <= strs.length <= 200
Write a function that finds the longest common prefix among an array of strings.
輸入: strs = ["flower","flow","flight"] 輸出: fl
輸入: strs = ["dog","racecar","car"] 輸出:
1 <= strs.length <= 200