일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- 109. Convert Sorted List to Binary Search Tree
- Convert Sorted List to Binary Search Tree
- Generator
- iterator
- Python Code
- Regular Expression
- Python
- t1
- 43. Multiply Strings
- Class
- shiba
- Protocol
- Python Implementation
- 315. Count of Smaller Numbers After Self
- LeetCode
- 운영체제
- 30. Substring with Concatenation of All Words
- 파이썬
- 시바견
- DWG
- 컴퓨터의 구조
- 715. Range Module
- Decorator
- 밴픽
- Substring with Concatenation of All Words
- concurrency
- attribute
- data science
- kaggle
- 프로그래머스
Archives
- Today
- Total
목록Longest Substring Without Repeating Characters (1)
Scribbling
LeetCode: 3. Longest Substring Without Repeating Characters
class Solution: def lengthOfLongestSubstring(self, s: str) -> int: char_set = set() l = 0 max_len = 0 for r in range(len(s)): if s[r] in char_set: while s[r] in char_set: char_set.remove(s[l]) l += 1 char_set.add(s[r]) max_len = max(max_len, r - l + 1) return max_len
Computer Science/Coding Test
2021. 8. 11. 17:23