Skip to content

Commit 5b2d16f

Browse files
Add time and space complexity for LC31
1 parent 0dd0b74 commit 5b2d16f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

LC31-Next-Permutation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ class Solution:
3535
def nextPermutation(self, nums: List[int]) -> None:
3636
"""
3737
Do not return anything, modify nums in-place instead.
38+
39+
Time complexity: O(n)
40+
Space complexity: O(1)
3841
"""
3942
# pre-plan
4043
# if nums[-2] < nums[-1], swap them, and we are done

0 commit comments

Comments
 (0)