일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Python Code
- Python Implementation
- Substring with Concatenation of All Words
- shiba
- iterator
- kaggle
- Generator
- 컴퓨터의 구조
- concurrency
- 109. Convert Sorted List to Binary Search Tree
- 715. Range Module
- LeetCode
- 시바견
- 밴픽
- 파이썬
- attribute
- DWG
- data science
- 30. Substring with Concatenation of All Words
- Regular Expression
- Class
- Protocol
- Python
- t1
- 43. Multiply Strings
- Decorator
- Convert Sorted List to Binary Search Tree
Archives
- Today
- Total
목록Maximum Product Subarray (1)
Scribbling
LeetCode: 152. Maximum Product Subarray
class Solution: def maxProduct(self, nums: List[int]) -> int: ret = -int(1e9) prod = 1 for num in nums: prod *= num ret = max(ret, prod) if num == 0: prod = 1 prod = 1 for i in range(len(nums)-1, -1, -1): prod *= nums[i] ret = max(ret, prod) if nums[i] == 0: prod = 1 return ret
Computer Science/Coding Test
2021. 11. 29. 16:42