Skip to content

Commit 75441ff

Browse files
committed
update readme
1 parent 642a3f5 commit 75441ff

File tree

5 files changed

+13
-103
lines changed

5 files changed

+13
-103
lines changed

0031-next-permutation/0031-next-permutation.py

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

0031-next-permutation/README.md

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

Python/0031-next-permutation.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from itertools import permutations
1+
# time complexity: O(n^2)
2+
# space complexity: O(1)
23
from typing import List
34

45

@@ -31,3 +32,7 @@ def nextPermutation(self, nums: List[int]) -> None:
3132

3233
nums = [1, 2, 3]
3334
print(Solution().nextPermutation(nums))
35+
nums = [3, 2, 1]
36+
print(Solution().nextPermutation(nums))
37+
nums = [1, 1, 5]
38+
print(Solution().nextPermutation(nums))

README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +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-
| [0031-next-permutation](https://github.com/hogan-tech/leetcode-solution/tree/master/0031-next-permutation) |
125-
## Two Pointers
126-
| |
127-
| ------- |
128-
| [0031-next-permutation](https://github.com/hogan-tech/leetcode-solution/tree/master/0031-next-permutation) |
129-
<!---LeetCode Topics End-->

Readme/0031-next-permutation.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2><a href="https://leetcode.com/problems/next-permutation/">31. Next Permutation</a></h2><h3>Medium</h3><hr><div><p>A <strong>permutation</strong> of an array of integers is an arrangement of its members into a sequence or linear order.</p>
1+
<h2><a href="https://leetcode.com/problems/next-permutation">31. Next Permutation</a></h2><h3>Medium</h3><hr><p>A <strong>permutation</strong> of an array of integers is an arrangement of its members into a sequence or linear order.</p>
22

33
<ul>
44
<li>For example, for <code>arr = [1,2,3]</code>, the following are all the permutations of <code>arr</code>: <code>[1,2,3], [1,3,2], [2, 1, 3], [2, 3, 1], [3,1,2], [3,2,1]</code>.</li>
@@ -19,19 +19,22 @@
1919
<p>&nbsp;</p>
2020
<p><strong class="example">Example 1:</strong></p>
2121

22-
<pre><strong>Input:</strong> nums = [1,2,3]
22+
<pre>
23+
<strong>Input:</strong> nums = [1,2,3]
2324
<strong>Output:</strong> [1,3,2]
2425
</pre>
2526

2627
<p><strong class="example">Example 2:</strong></p>
2728

28-
<pre><strong>Input:</strong> nums = [3,2,1]
29+
<pre>
30+
<strong>Input:</strong> nums = [3,2,1]
2931
<strong>Output:</strong> [1,2,3]
3032
</pre>
3133

3234
<p><strong class="example">Example 3:</strong></p>
3335

34-
<pre><strong>Input:</strong> nums = [1,1,5]
36+
<pre>
37+
<strong>Input:</strong> nums = [1,1,5]
3538
<strong>Output:</strong> [1,5,1]
3639
</pre>
3740

@@ -42,4 +45,3 @@
4245
<li><code>1 &lt;= nums.length &lt;= 100</code></li>
4346
<li><code>0 &lt;= nums[i] &lt;= 100</code></li>
4447
</ul>
45-
</div>

0 commit comments

Comments
 (0)