首页
Java
登录
6mi
u
盘
搜
搜 索
Java
485. Max Consecutive Ones
485. Max Consecutive Ones
xiaoxiao
2021-02-27
975
class
Solution
(object)
:
def
findMaxConsecutiveOnes
(self, nums)
:
""" :type nums: List[int] :rtype: int """
max_count =
0
count =
0
for
num
in
nums:
if
num ==
1
: count +=
1
max_count = max(max_count,count)
else
: count =
0
return
max_count
转载请注明原文地址: https://www.6miu.com/read-157.html
2012-2014专利技术
最新回复
(
0
)