Skip to content

Commit 6336b4d

Browse files
committed
update readme
1 parent e67382a commit 6336b4d

File tree

9 files changed

+46
-104
lines changed

9 files changed

+46
-104
lines changed

.github/test.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
3228-maximum-number-of-operations-to-move-ones-to-the-end python medium
1+
1470-shuffle-the-array python easy
2+
1929-concatenation-of-array python easy

1580-shuffle-the-array/1580-shuffle-the-array.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

1580-shuffle-the-array/README.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

Python/1470-shuffle-the-array.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# time complexity: O(n)
2+
# space complexity: O(1)
13
from typing import List
24

35

@@ -13,3 +15,9 @@ def shuffle(self, nums: List[int], n: int) -> List[int]:
1315
nums = [2, 5, 1, 3, 4, 7]
1416
n = 3
1517
print(Solution().shuffle(nums, n))
18+
nums = [1, 2, 3, 4, 4, 3, 2, 1]
19+
n = 4
20+
print(Solution().shuffle(nums, n))
21+
nums = [1, 1, 2, 2]
22+
n = 2
23+
print(Solution().shuffle(nums, n))

Question_List_1001_2000.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@
397397
| 1921 | [Eliminate Maximum Number of Monsters](https://leetcode.com/problems/eliminate-maximum-number-of-monsters/) | [Python](./Python/1921-eliminate-maximum-number-of-monsters.py) | [Medium](./Readme/1921-eliminate-maximum-number-of-monsters.md) |
398398
| 1922 | [Count Good Numbers](https://leetcode.com/problems/count-good-numbers) | [Python](./Python/1922-count-good-numbers.py) | [Medium](./Readme/1922-count-good-numbers.md) |
399399
| 1926 | [Nearest Exit from Entrance in Maze](https://leetcode.com/problems/nearest-exit-from-entrance-in-maze/) | [Python](./Python/1926-nearest-exit-from-entrance-in-maze.py) | [Medium](./Readme/1926-nearest-exit-from-entrance-in-maze.md) |
400+
| 1929 | [Concatenation of Array](https://leetcode.com/problems/concatenation-of-array/) | [Python](./Python/1929-concatenation-of-array.py) | [Easy](./Readme/1929-concatenation-of-array.md) |
400401
| 1930 | [Unique Length-3 Palindromic Subsequences](https://leetcode.com/problems/unique-length-3-palindromic-subsequences/) | [Python](./Python/1930-unique-length-3-palindromic-subsequences.py) | [Medium](./Readme/1930-unique-length-3-palindromic-subsequences.md) |
401402
| 1931 | [Painting a Grid With Three Different Colors](https://leetcode.com/problems/painting-a-grid-with-three-different-colors) | [Python](./Python/1931-painting-a-grid-with-three-different-colors.py) | [Hard](./Readme/1931-painting-a-grid-with-three-different-colors.md) |
402403
| 1934 | [Confirmation Rate](https://leetcode.com/problems/confirmation-rate/) | [SQL](./SQL/1934-confirmation-rate.sql) | [Medium](./Readme/1934-confirmation-rate.md) |

README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,3 @@ It helps others discover the repo and keeps the project growing.
115115
---
116116

117117
Feedback / Questions → open an Issue or reach out on [LinkedIn](https://www.linkedin.com/in/hogan-l/)
118-
119-
<!---LeetCode Topics Start-->
120-
# LeetCode Topics
121-
## Array
122-
| |
123-
| ------- |
124-
| [1580-shuffle-the-array](https://github.com/hogan-tech/leetcode-solution/tree/master/1580-shuffle-the-array) |
125-
| [2058-concatenation-of-array](https://github.com/hogan-tech/leetcode-solution/tree/master/2058-concatenation-of-array) |
126-
## Simulation
127-
| |
128-
| ------- |
129-
| [2058-concatenation-of-array](https://github.com/hogan-tech/leetcode-solution/tree/master/2058-concatenation-of-array) |
130-
<!---LeetCode Topics End-->

Readme/1470-shuffle-the-array.md

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1-
<h2><a href="https://leetcode.com/problems/shuffle-the-array/">1470. Shuffle the Array</a></h2><h3>Easy</h3><hr><div><p>Given the array <code>nums</code> consisting of <code>2n</code> elements in the form <code>[x<sub>1</sub>,x<sub>2</sub>,...,x<sub>n</sub>,y<sub>1</sub>,y<sub>2</sub>,...,y<sub>n</sub>]</code>.</p>
2-
3-
<p><em>Return the array in the form</em> <code>[x<sub>1</sub>,y<sub>1</sub>,x<sub>2</sub>,y<sub>2</sub>,...,x<sub>n</sub>,y<sub>n</sub>]</code>.</p>
4-
5-
<p>&nbsp;</p>
6-
<p><strong class="example">Example 1:</strong></p>
7-
8-
<pre><strong>Input:</strong> nums = [2,5,1,3,4,7], n = 3
9-
<strong>Output:</strong> [2,3,5,4,1,7]
10-
<strong>Explanation:</strong> Since x<sub>1</sub>=2, x<sub>2</sub>=5, x<sub>3</sub>=1, y<sub>1</sub>=3, y<sub>2</sub>=4, y<sub>3</sub>=7 then the answer is [2,3,5,4,1,7].
11-
</pre>
12-
13-
<p><strong class="example">Example 2:</strong></p>
14-
15-
<pre><strong>Input:</strong> nums = [1,2,3,4,4,3,2,1], n = 4
16-
<strong>Output:</strong> [1,4,2,3,3,2,4,1]
17-
</pre>
18-
19-
<p><strong class="example">Example 3:</strong></p>
20-
21-
<pre><strong>Input:</strong> nums = [1,1,2,2], n = 2
22-
<strong>Output:</strong> [1,2,1,2]
23-
</pre>
24-
25-
<p>&nbsp;</p>
26-
<p><strong>Constraints:</strong></p>
27-
28-
<ul>
29-
<li><code>1 &lt;= n &lt;= 500</code></li>
30-
<li><code>nums.length == 2n</code></li>
31-
<li><code>1 &lt;= nums[i] &lt;= 10^3</code></li>
32-
</ul></div>
1+
<h2><a href="https://leetcode.com/problems/shuffle-the-array">1580. Shuffle the Array</a></h2><h3>Easy</h3><hr><p>Given the array <code>nums</code> consisting of <code>2n</code> elements in the form <code>[x<sub>1</sub>,x<sub>2</sub>,...,x<sub>n</sub>,y<sub>1</sub>,y<sub>2</sub>,...,y<sub>n</sub>]</code>.</p>
2+
3+
<p><em>Return the array in the form</em> <code>[x<sub>1</sub>,y<sub>1</sub>,x<sub>2</sub>,y<sub>2</sub>,...,x<sub>n</sub>,y<sub>n</sub>]</code>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre>
9+
<strong>Input:</strong> nums = [2,5,1,3,4,7], n = 3
10+
<strong>Output:</strong> [2,3,5,4,1,7]
11+
<strong>Explanation:</strong> Since x<sub>1</sub>=2, x<sub>2</sub>=5, x<sub>3</sub>=1, y<sub>1</sub>=3, y<sub>2</sub>=4, y<sub>3</sub>=7 then the answer is [2,3,5,4,1,7].
12+
</pre>
13+
14+
<p><strong class="example">Example 2:</strong></p>
15+
16+
<pre>
17+
<strong>Input:</strong> nums = [1,2,3,4,4,3,2,1], n = 4
18+
<strong>Output:</strong> [1,4,2,3,3,2,4,1]
19+
</pre>
20+
21+
<p><strong class="example">Example 3:</strong></p>
22+
23+
<pre>
24+
<strong>Input:</strong> nums = [1,1,2,2], n = 2
25+
<strong>Output:</strong> [1,2,1,2]
26+
</pre>
27+
28+
<p>&nbsp;</p>
29+
<p><strong>Constraints:</strong></p>
30+
31+
<ul>
32+
<li><code>1 &lt;= n &lt;= 500</code></li>
33+
<li><code>nums.length == 2n</code></li>
34+
<li><code>1 &lt;= nums[i] &lt;= 10^3</code></li>
35+
</ul>
File renamed without changes.

0 commit comments

Comments
 (0)