原文:[LeetCode] Max Consecutive Ones II 最大連續1的個數之二

Given a binary array, find the maximum number of consecutive s in this array if you can flip at most one . Example : Note: The input array will only contain and . The length of input array is a posit ...

2017-02-07 22:15 2 8090 推薦指數:

查看詳情

Leetcode練習(Python):第485題:最大連續1的個數:給定一個二進制數組, 計算其中最大連續1的個數

題目: 最大連續1的個數:給定一個二進制數組, 計算其中最大連續1的個數。 示例 1: 輸入: [1,1,0,1,1,1]輸出: 3解釋: 開頭的兩位和最后的三位都是連續1,所以最大連續1的個數是 3.注意: 輸入的數組只包含 0 和1。輸入數組的長度是正整數,且不超過 10,000 ...

Tue Jun 02 00:08:00 CST 2020 0 620
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM