일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 운영체제
- Class
- 715. Range Module
- attribute
- Protocol
- DWG
- Python
- 30. Substring with Concatenation of All Words
- 컴퓨터의 구조
- 109. Convert Sorted List to Binary Search Tree
- 43. Multiply Strings
- 밴픽
- iterator
- 프로그래머스
- shiba
- t1
- Substring with Concatenation of All Words
- 315. Count of Smaller Numbers After Self
- 시바견
- Convert Sorted List to Binary Search Tree
- LeetCode
- concurrency
- Python Implementation
- kaggle
- data science
- 파이썬
- Decorator
- Generator
- Python Code
- Regular Expression
Archives
- Today
- Total
목록1048. Longest String Chain (1)
Scribbling
LeetCode: 1048. Longest String Chain
class Solution: def longestStrChain(self, words: List[str]) -> int: ret = 1 # First, we sort words by its length # By this way, we only need to check the previous length (or current length - 1) # That is, if the length(word) is k, # We only need to check words that have length of k - 1. words.sort(key=lambda word: len(word)) # dp[word]: max chain length until the word dp = {} for word in words: ..
Computer Science/Coding Test
2022. 2. 27. 15:39