首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

LeetCode笔记 14.Longest Common PrefixEasy

微信公众号:特里斯丹

这里我们有梦

关于文学,关于爱情

关于穿越世界的旅行

github:

https://github.com/weidafeng/LeetCode_Python

这是每周刷LeetCode系列的第5篇笔记

第5周 14. Longest Common Prefix [Easy]

https://leetcode.com/problems/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 .

Example 1:

Input:["flower","flow","flight"]Output:"fl"

Example 2:

Input:["dog","racecar","car"]Output:""Explanation:There is no common prefix among the input strings.

Note:

All given inputs are in lowercase letters .

提交记录:

github里补充了算法示意图、zip函数介绍等,欢迎star

专栏介绍

1、本专栏是我刷LeetCode的学习笔记,每周更新一次

2、所有代码均已上传至github,欢迎star、watch:

https://github.com/weidafeng/LeetCode_Python

3、python语言实现,至少用两种思路,争取用最简洁的代码实现

4、欢迎指正、讨论

如果帮到你了

欢迎点赞+分享

感谢

  • 发表于:
  • 原文链接https://kuaibao.qq.com/s/20181228G0YI0D00?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券