Skip to content

Commit 92bdfb0

Browse files
committed
Added README.md file for Max Consecutive Ones
1 parent 8762495 commit 92bdfb0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

485-max-consecutive-ones/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<h2><a href="https://leetcode.com/problems/max-consecutive-ones">Max Consecutive Ones</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>Given a binary array <code>nums</code>, return <em>the maximum number of consecutive </em><code>1</code><em>&#39;s in the array</em>.</p>
2+
3+
<p>&nbsp;</p>
4+
<p><strong class="example">Example 1:</strong></p>
5+
6+
<pre>
7+
<strong>Input:</strong> nums = [1,1,0,1,1,1]
8+
<strong>Output:</strong> 3
9+
<strong>Explanation:</strong> The first two digits or the last three digits are consecutive 1s. The maximum number of consecutive 1s is 3.
10+
</pre>
11+
12+
<p><strong class="example">Example 2:</strong></p>
13+
14+
<pre>
15+
<strong>Input:</strong> nums = [1,0,1,1,0,1]
16+
<strong>Output:</strong> 2
17+
</pre>
18+
19+
<p>&nbsp;</p>
20+
<p><strong>Constraints:</strong></p>
21+
22+
<ul>
23+
<li><code>1 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>
24+
<li><code>nums[i]</code> is either <code>0</code> or <code>1</code>.</li>
25+
</ul>

0 commit comments

Comments
 (0)