일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 파이썬
- Python Implementation
- 43. Multiply Strings
- Generator
- Protocol
- 시바견
- LeetCode
- kaggle
- Regular Expression
- t1
- iterator
- shiba
- 30. Substring with Concatenation of All Words
- 밴픽
- Python Code
- 715. Range Module
- data science
- Decorator
- attribute
- 운영체제
- Class
- Substring with Concatenation of All Words
- 315. Count of Smaller Numbers After Self
- Python
- DWG
- 109. Convert Sorted List to Binary Search Tree
- concurrency
- Convert Sorted List to Binary Search Tree
- 프로그래머스
- 컴퓨터의 구조
Archives
- Today
- Total
목록395. Longest Substring with At Least K Repeating Characters (1)
Scribbling
LeetCode: 395. Longest Substring with At Least K Repeating Characters
Idea: Any characters that have frequencies less than k work as a breakpoints, meaning that the substring we're looking for can't include that particular character. So, recursively look for substrings while excluding those characters. Time complexity is O(N). from collections import Counter class Solution: def longestSubstring(self, s: str, k: int) -> int: return self.helper(s, k) def helper(self..
Computer Science/Coding Test
2022. 1. 16. 13:49