일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- LeetCode
- Regular Expression
- 30. Substring with Concatenation of All Words
- Decorator
- 파이썬
- shiba
- 운영체제
- iterator
- 43. Multiply Strings
- Python Implementation
- 715. Range Module
- Convert Sorted List to Binary Search Tree
- 시바견
- 109. Convert Sorted List to Binary Search Tree
- concurrency
- Generator
- 밴픽
- 315. Count of Smaller Numbers After Self
- Python
- t1
- Python Code
- Protocol
- 프로그래머스
- Substring with Concatenation of All Words
- DWG
- 컴퓨터의 구조
- Class
- attribute
- kaggle
- data science
Archives
- Today
- Total
목록115. Distinct Subsequences (1)
Scribbling
LeetCode: 115. Distinct Subsequences
1. 완전탐색 완전탐색으로 짜잔하고 풀리면 hard일리가 없지. 역시 Time Out class Solution: def numDistinct(self, s: str, t: str) -> int: self.answer = 0 self.dfs(s, t) return self.answer def dfs(self, s, t): if not t: self.answer += 1 return target = t[0] for i, char in enumerate(s): if char == target: self.dfs(s[i+1:], t[1:]) 2. DP 문자열을 탐색 혹은 비교하는 문제는 대부분 DP인 경우가 많다. 말그대로 dp다. 문제는 이것도 Time Out class Solution: def numDist..
Computer Science/Coding Test
2021. 10. 27. 21:10