Skip to content

Commit 49411a9

Browse files
committedMar 25, 2021
Create README - LeetHub
1 parent a01391a commit 49411a9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
 

‎contiguous-array/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<h2>525. Contiguous Array</h2><h3>Medium</h3><hr><div><p>Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. </p>
2+
3+
4+
<p><b>Example 1:</b><br>
5+
</p><pre><b>Input:</b> [0,1]
6+
<b>Output:</b> 2
7+
<b>Explanation:</b> [0, 1] is the longest contiguous subarray with equal number of 0 and 1.
8+
</pre>
9+
<p></p>
10+
11+
<p><b>Example 2:</b><br>
12+
</p><pre><b>Input:</b> [0,1,0]
13+
<b>Output:</b> 2
14+
<b>Explanation:</b> [0, 1] (or [1, 0]) is a longest contiguous subarray with equal number of 0 and 1.
15+
</pre>
16+
<p></p>
17+
18+
<p><b>Note:</b>
19+
The length of the given binary array will not exceed 50,000.
20+
</p></div>

0 commit comments

Comments
 (0)