Leetcode#14. Longest Common Prefix
#Problem
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 ""
.
Example 1:
1 | Input: strs = ["flower","flow","flight"] |
Example 2:
1 | Input: strs = ["dog","racecar","car"] |
Solve
1 | class Solution: |
本部落格所有文章除特別聲明外,均採用 CC BY-NC-SA 4.0 許可協議。轉載請註明來自 Imisky!
評論