LeetCode 3. Longest Substring Without Repeating Characters
来源:互联网 发布:windows怎么安装服务 编辑:程序博客网 时间:2024/06/08 02:12
class Solution(object): def lengthOfLongestSubstring(self, s): """ :type s: str :rtype: int """ dict = {} maxLen = 0 begin = 0 for ind, val in enumerate(s): if val in dict and dict[val] >= begin: begin = dict[val] + 1 dict[val] = ind maxLen = max(maxLen, ind - begin +1) return maxLen
阅读全文
0 0
- [LeetCode]3.Longest Substring Without Repeating Characters
- LeetCode 3.Longest Substring Without Repeating Characters
- LeetCode --- 3. Longest Substring Without Repeating Characters
- [Leetcode] 3. Longest Substring Without Repeating Characters
- [leetcode] 3.Longest Substring Without Repeating Characters
- [leetcode] 3. Longest Substring Without Repeating Characters
- [Leetcode]3. Longest Substring Without Repeating Characters
- leetcode 3. Longest Substring Without Repeating Characters
- 【Leetcode】3. Longest Substring Without Repeating Characters
- leetcode 3. Longest Substring Without Repeating Characters
- LeetCode-3.Longest Substring Without Repeating Characters
- LeetCode 3.Longest Substring Without Repeating Characters
- LeetCode - 3.Longest Substring Without Repeating Characters
- Leetcode 3. Longest Substring Without Repeating Characters
- 3. Longest Substring Without Repeating Characters LeetCode
- (Leetcode)3. Longest Substring Without Repeating Characters
- leetcode 3. Longest Substring Without Repeating Characters
- LeetCode-3. Longest Substring Without Repeating Characters
- 序列与元组_笔记
- LeetCode之Count and Say
- LeetCode 2. Add Two Numbers
- js中const,var,let区别
- 复习_简单命令
- LeetCode 3. Longest Substring Without Repeating Characters
- 复习_文件
- MAVEN配置以及使用
- NodeJS的面向对象编程
- linux(CentOS7 64位)下安装 jdk
- 哈希算法相关解析
- Javascript 面向对象编程 封装
- Docker之Docker介绍及安装配置
- JDK,JRE,JVM介绍和区别