当前位置:网站首页>Longest common front string
Longest common front string
2022-04-23 09:51:00 【AI Zeng Xiaojian】
class Solution:
def longestCommonPrefix(self,strs):
res =""
for tmp in zip(*strs):
tmp_set = set(tmp)
if len(tmp_set) ==1:
res+= tmp[0]
else:
break
return res
class Solution:
def longestCommonPrefix(self, strs):
res =""
for tmp in zip(*strs):
tmp_set = set(tmp)
if len(tmp_set) ==1:
res += tmp[0]
else:
break
return res
版权声明
本文为[AI Zeng Xiaojian]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230945449485.html
边栏推荐
- Pyqt5与通信
- Redis 内存占满导致的 Setnx 命令执行失败
- [COCI] lattice (dichotomy + tree divide and conquer + string hash)
- PHP two-dimensional array specifies that the elements are added after they are equal, otherwise new
- P1446 [hnoi2008] cards (Burnside theorem + DP count)
- 个人主页软件Fenrus
- Career planning and implementation in the era of meta universe
- 论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》——5结果
- MySQL of database -- overview and installation
- Skill point digging
猜你喜欢
个人主页软件Fenrus
Planning and construction of industrial meta universe platform
MySQL of database -- overview and installation
Cloud identity is too loose, opening the door for attackers
Acquisition of DOM learning elements JS
计算机网络安全实验二|DNS协议漏洞利用实验
Redis 异常 read error on connection 解决方案
C language: expression evaluation (integer promotion, arithmetic conversion...)
NEC红外遥控编码说明
元宇宙时代的职业规划与执行
随机推荐
元宇宙时代的职业规划与执行
代码源每日一题 div1 (701-707)
Personal homepage software fenrus
Exclusive thoughts and cases of JS
formatTime时间戳格式转换
KVM installation and deployment
SAP excel has completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.
《谷雨系列》空投
JS scope, scope chain, global variables and local variables
1D / 1D dynamic programming learning summary
[educational codeforces round 80] problem solving Report
Prefix sum of integral function -- Du Jiao sieve
PHP笔记(一):开发环境配置
论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》——3背景
Compile and debug mysql8 with clion under MacOS x
[hdu6833] a very easy math problem
SAP salv14 background output salv data can directly save files and send emails (with sorting, hyperlink and filtering format)
(Extended) bsgs and higher order congruence equation
Es aggregation aggregation analysis
Kernel PWN learning (4) -- double fetch & 0ctf2018 baby