微信公众号:特里斯丹
这里我们有梦
关于文学,关于爱情
关于穿越世界的旅行
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、欢迎指正、讨论
如果帮到你了
欢迎点赞+分享
感谢
领取专属 10元无门槛券
私享最新 技术干货