LeetCode -- 求字符串数组中的最长公共前缀

题目描述: Write a function to find the longest common prefix string amongst an array of strings. 就是给定1个字符串数组,找出公共最长前缀。 思路很直接,使用1个索引来存最长公共前缀的长度就能够了。 注意, 若是使用1个字符串变量来存前缀的话,是不能AC的,由于题目不容许使用额外的空间。 public stri
相关文章
相关标签/搜索