Leetcode 485. Max Consecutive Ones 最大连续1 解题报告

1 解题思想 统计一个只有1和0的二进制数组,统计1连续出现的最大长度 这道题实在太简单,顺序统计就好,两个变量,一个保存最大值,一个保存当前的连续的1的数量git 2 原题 Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1]
相关文章
相关标签/搜索