Skip to content

Commit 933ba39

Browse files
Create README - LeetHub
1 parent bb863ab commit 933ba39

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

sort-array-by-parity/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<h2>905. Sort Array By Parity</h2><h3>Easy</h3><hr><div><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>Example 1:</strong></p>
7+
8+
<pre><strong>Input:</strong> nums = [3,1,2,4]
9+
<strong>Output:</strong> [2,4,3,1]
10+
<strong>Explanation:</strong> The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted.
11+
</pre>
12+
13+
<p><strong>Example 2:</strong></p>
14+
15+
<pre><strong>Input:</strong> nums = [0]
16+
<strong>Output:</strong> [0]
17+
</pre>
18+
19+
<p>&nbsp;</p>
20+
<p><strong>Constraints:</strong></p>
21+
22+
<ul>
23+
<li><code>1 &lt;= nums.length &lt;= 5000</code></li>
24+
<li><code>0 &lt;= nums[i] &lt;= 5000</code></li>
25+
</ul>
26+
</div>

0 commit comments

Comments
 (0)