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]
相關文章
相關標籤/搜索