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