标签:python self type dma 最大连续 def 最大 int nes
class Solution:
def findMaxConsecutiveOnes(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
res = 0
curr = 0
for i in nums:
if i != 0:
curr += 1
else:
res = max(res, curr)
curr = 0
res = max(res, curr)
return res
leetcode485 python3 88ms 最大连续1的个数
标签:python self type dma 最大连续 def 最大 int nes
原文地址:https://www.cnblogs.com/theodoric008/p/9420613.html