欢迎来我Python萌新的小站

[LEEDCode][014][简单] – 最长公共前缀(Longest Common Prefix)

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 "".

编写一个函数来查找字符串数组中的最长公共前缀。

如果不存在公共前缀,返回空字符串 ""

示例 1:

示例 2:

说明:

所有输入只包含小写字母 a-z 。

解答

状态 执行用时 语言
几秒前 通过 56 ms python3
喜欢 (0)分享 (0)
发表我的评论
取消评论
友情提示:插入代码时请使用:  <pre>要插入的代码</pre>   以达到最佳效果!

表情     4 + 1 = ? (必填)

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址