일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- t1
- data science
- Python
- LeetCode
- Generator
- concurrency
- Substring with Concatenation of All Words
- DWG
- kaggle
- Convert Sorted List to Binary Search Tree
- shiba
- 109. Convert Sorted List to Binary Search Tree
- Class
- 밴픽
- 컴퓨터의 구조
- Decorator
- 30. Substring with Concatenation of All Words
- 파이썬
- 43. Multiply Strings
- 시바견
- 715. Range Module
- 프로그래머스
- Regular Expression
- 운영체제
- 315. Count of Smaller Numbers After Self
- Python Implementation
- attribute
- Protocol
- Python Code
Archives
- Today
- Total
목록123. Best Time to Buy and Sell Stock III (1)
Scribbling
LeetCode: 123. Best Time to Buy and Sell Stock III
class Solution(object): def maxProfit(self, prices): """ :type prices: List[int] :rtype: int """ n = len(prices) leftprofit, rightprofit = [0] * n, [0] * n leftmin = prices[0] for i in range(1, n): price = prices[i] leftmin = min(leftmin, price) leftprofit[i] = max(leftprofit[i-1], price - leftmin) rightmax = prices[-1] for i in range(n-2, -1, -1): price = prices[i] rightmax = max(rightmax, pric..
Computer Science/Coding Test
2021. 11. 3. 21:40