일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- iterator
- Python Implementation
- 프로그래머스
- Generator
- data science
- t1
- 109. Convert Sorted List to Binary Search Tree
- Regular Expression
- 운영체제
- concurrency
- 컴퓨터의 구조
- 밴픽
- Substring with Concatenation of All Words
- Protocol
- shiba
- 715. Range Module
- 파이썬
- LeetCode
- Decorator
- DWG
- 시바견
- kaggle
- attribute
- 43. Multiply Strings
- Python Code
- 315. Count of Smaller Numbers After Self
- Convert Sorted List to Binary Search Tree
- Class
- 30. Substring with Concatenation of All Words
- Python
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