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