일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Convert Sorted List to Binary Search Tree
- Python Code
- 운영체제
- shiba
- Decorator
- Substring with Concatenation of All Words
- 파이썬
- data science
- kaggle
- Regular Expression
- iterator
- 715. Range Module
- 시바견
- 컴퓨터의 구조
- 30. Substring with Concatenation of All Words
- 밴픽
- concurrency
- 315. Count of Smaller Numbers After Self
- attribute
- 43. Multiply Strings
- Generator
- t1
- DWG
- Python
- Protocol
- 109. Convert Sorted List to Binary Search Tree
- LeetCode
- Class
- Python Implementation
- 프로그래머스
Archives
- Today
- Total
Scribbling
LeetCode: 53. Maximum Subarray 본문
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
ret = -int(1e9)
now = 0
for num in nums:
now += num
ret = max(ret, now)
if now <= 0:
now = 0
return ret
'Computer Science > Coding Test' 카테고리의 다른 글
LeetCode: 60. Permutation Sequence (0) | 2021.09.24 |
---|---|
LeetCode: 59. Spiral Matrix II (0) | 2021.09.24 |
LeetCode: 57. Insert Interval (0) | 2021.09.24 |
LeetCode: 56. Merge Intervals (0) | 2021.09.23 |
LeetCode: 54. Spiral Matrix (1) | 2021.09.17 |