Permutation Sequence

Solution
Verifying access...

Time Complexity

O(n^2)SPACE_COMPLEXITY: O(n)---PYTHON---class Solution:def getPermutation(self, n: int, k: int) -> str:fact = [1] * nnums = []for i in range(1, n):

Space Complexity

O(n)---PYTHON---class Solution:def getPermutation(self, n: int, k: int) -> str:fact = [1] * nnums = []for i in range(1, n):