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