Skip to content

Commit 3eb050e

Browse files
committed
Added README.md file for Sort Array By Parity
1 parent f4c7704 commit 3eb050e

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

941-sort-array-by-parity/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<h2><a href="https://leetcode.com/problems/sort-array-by-parity">Sort Array By Parity</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>Given an integer array <code>nums</code>, move all the even integers at the beginning of the array followed by all the odd integers.</p>
2+
3+
<p>Return <em><strong>any array</strong> that satisfies this condition</em>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre>
9+
<strong>Input:</strong> nums = [3,1,2,4]
10+
<strong>Output:</strong> [2,4,3,1]
11+
<strong>Explanation:</strong> The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted.
12+
</pre>
13+
14+
<p><strong class="example">Example 2:</strong></p>
15+
16+
<pre>
17+
<strong>Input:</strong> nums = [0]
18+
<strong>Output:</strong> [0]
19+
</pre>
20+
21+
<p>&nbsp;</p>
22+
<p><strong>Constraints:</strong></p>
23+
24+
<ul>
25+
<li><code>1 &lt;= nums.length &lt;= 5000</code></li>
26+
<li><code>0 &lt;= nums[i] &lt;= 5000</code></li>
27+
</ul>

0 commit comments

Comments
 (0)