leetcode 485[easy]---Max Consecutive Ones

来源:互联网 发布:淘宝差评有什么后果 编辑:程序博客网 时间:2024/05/21 22:42

Given a binary array, find the maximum number of consecutive 1s in this array.

Example 1:

Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits are consecutive 1s.    The maximum number of consecutive 1s is 3.

Note:

  • The input array will only contain 0 and 1.
  • The length of input array is a positive integer and will not exceed 10,000
思路:找到array中最长的连续1的个数。


阅读全文
'); })();
0 0
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 捷波朗耳机配件 捷波朗app下载 捷波朗耳机好不好 捷波朗耳机怎么样 捷波朗耳机 捷波朗蓝牙耳机连接不上 捷波朗蓝牙耳机连接 捷波朗哪款蓝牙耳机好 捷波朗蓝牙耳机说明书 捷波朗蓝牙耳机配对 jabra耳机 五一贷 物业贷 汉中贷款 九江贷款 驾照贷款 柳州贷款 上饶贷款 接力贷款条件 捷盛冷柜 税捷财税 捷税宝 捷组词 捷世达电锤 捷诺维 捷诺维多少钱一盒 捷诺维说明书 捷诺维价格 磷酸西格列汀片价格 西格列汀片说明书 默沙东捷诺维 捷诺达 捷诺达多少钱一盒 捷诺达说明书 捷诺达西格列汀二甲双胍850mg 捷贷金融 捷财贷 捷信属于网贷吗 捷信算网贷吗 郑州捷登教育 捷登都会公寓