博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
485. Max Consecutive Ones
阅读量:2801 次
发布时间:2019-05-13

本文共 362 字,大约阅读时间需要 1 分钟。

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

转载地址:http://sjnmd.baihongyu.com/

你可能感兴趣的文章
JAVA -- NPOI在excel中画直线
查看>>
JAVA -- 小结
查看>>
JAVA -- 在页面中得到地址栏中参数的值并传递
查看>>
JAVA -- POI导出excel
查看>>
JAVA -- Java compiler level does not match the version of the installed Java project facet.
查看>>
JAVA -- ant编译时出现Compile failed; see the compiler error output for details异常
查看>>
WEB前端 -- 读取下拉框中的text、value
查看>>
JAVA -- 获取时间
查看>>
PowerDesigner初用问题解决
查看>>
Oracle -- like、instr()、substr()
查看>>
UIWindow
查看>>
GCDAsyncSocket类库,IOS下TCP通讯使用心得
查看>>
block使用小结、使用block、如何防止循环引用
查看>>
程序员高效率工作工具推荐(必备工具)
查看>>
iOS多线程编程之NSThread的使用
查看>>
使用Xcode和Instruments调试解决iOS内存泄露
查看>>
CoreData底层架构实现 概述
查看>>
#import和@class在IOS中的区别
查看>>
a valid provisioning profile for this executable was not found错误
查看>>
使用Cocoapods创建私有podspec
查看>>