Leetcode Algorithms -- Longest Common Prefix
Longest Common Prefix (Easy)
Description
Write a function to find the longest common prefix string amongst an array of strings.
Analysis
感觉自己的方法不是很好。应该有更快的方法。。求n个字符串的公共前缀
My Solution
1 | //C++ |
Write a function to find the longest common prefix string amongst an array of strings.
感觉自己的方法不是很好。应该有更快的方法。。求n个字符串的公共前缀
1 | //C++ |