일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 315. Count of Smaller Numbers After Self
- Generator
- Decorator
- Substring with Concatenation of All Words
- data science
- Protocol
- attribute
- Convert Sorted List to Binary Search Tree
- 30. Substring with Concatenation of All Words
- iterator
- t1
- Python
- shiba
- 시바견
- 파이썬
- 운영체제
- kaggle
- 43. Multiply Strings
- Regular Expression
- Python Code
- 109. Convert Sorted List to Binary Search Tree
- 컴퓨터의 구조
- 밴픽
- concurrency
- Class
- LeetCode
- 프로그래머스
- DWG
- 715. Range Module
- Python Implementation
Archives
- Today
- Total
목록Palindrome Partitioning II (1)
Scribbling
LeetCode: 132. Palindrome Partitioning II
1. Bottom-up Solution + predefining palindromic matrix class Solution: def minCut(self, s: str) -> int: dp = self.build_palindrome(s) n = len(s) self.cut = [2002] * n for end in range(n): if dp[0][end]: self.cut[end] = 0 continue for start in range(1, end+1): if dp[start][end]: self.cut[end] = min(self.cut[end], self.cut[start-1] + 1) return self.cut[-1] def build_palindrome(self, word): n = len..
Computer Science/Coding Test
2021. 11. 13. 12:53