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