当前位置:网站首页>Leetcode question brushing record
Leetcode question brushing record
2022-07-23 17:20:00 【Five6667】
Link up
https://leetcode.cn/problems/longest-substring-without-repeating-characters/
Slide window template .
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
cur, res = [], 0
for r in range(len(s)):
while s[r] in cur:
cur.pop(0) # On the left
cur.append(s[r]) # The right side will enter the new one anyway
res = max(len(cur),res)
return res
边栏推荐
- Thoughts on software quality system
- 线程池,我是谁?我在哪儿?
- sprintf和cv::putText
- 12张图+6K字图解ZGC垃圾回收器及调优技巧
- 详解一次SQL优化
- 蓝桥杯真题:卡片[通俗易懂]
- Keil errors and solutions (1): fcarm - output name not specified, please check 'options for target - Utilities‘
- 考过PMP对实际工作帮助大吗?
- Sorting - introduction, code ideas, usage suggestions, code implementation -1
- OpenIM重大升级-群聊读扩散模型发布 群管理功能升级
猜你喜欢

keras——accuracy_ Score formula

PWN entry (3) heap

Search Binary Tree - find nodes, insert nodes, delete nodes

Compressed storage of arrays and special matrices

CSR、SSR 与 SSG

软件测试计划包括哪些内容,测试计划如何编写。分享测试计划模板

死磕遞歸1:遞推公式

keil错误和解决办法(1):FCARM - Output Name not specified, please check ‘Options for Target - Utilities‘

Detailed explanation of SQL error reporting and blind annotation

IR drop, EM, noise and antenna
随机推荐
Nodejs implements token login registration (koa2)
Pymoo学习 (1):基本概念
Vscode - code and file changes cannot be saved
Solution for iPhone unable to open openv** file
Preliminary understanding of string
UPC 2022暑期个人训练赛第12场(B 组合数)
动态库*.dll文件的Debug/Release版本是否可以混用(交叉用)?
How many common SQL misuses are there in MySQL?
Récursion des bosses 1: formule récursive
php文件锁抽奖防止并发
Kubernetes kubelet 硬核知识 架构
【mysql集群故障恢复】
Browser homology policy
Agile testing practice in large-scale teams
合宙ESP32C3基于VSCode PIO Arduino开发框架初探教程
【31. 走迷宫(BFS)】
July training (day 23) - dictionary tree
食品安全|选购益生菌类产品,你必须知道的八件事
SQL bool盲注和时间盲注详解
Keil errors and solutions (1): fcarm - output name not specified, please check 'options for target - Utilities‘