diff --git a/LeetCode/0060 - Permutation_Sequence.py b/LeetCode/0060 - Permutation_Sequence.py new file mode 100644 index 0000000..d28e294 --- /dev/null +++ b/LeetCode/0060 - Permutation_Sequence.py @@ -0,0 +1,16 @@ +from itertools import permutations +class Solution: + data = [] + + def getPermutation(self, n: int, k: int) -> str: + self.data = [] + string = [] + for i in range(1, n+1): + string.append(str(i)) + string = list(permutations(string)) + temp = string[k-1] + string = [] + string.append("".join(temp)) + return string[0] + +