Permutation Sequence

The problem involves finding the k-th permutation sequence of numbers from 1 to n, where there are a total of n! unique permutations. Given n and k, the task is to return the k-th permutation sequence.

Constraints

  • 1 <= n <= 9
  • 1 <= k <= n!
Saving… · 3 lines
class Solution:
def findKthPermutation(self, n: int, k: int) -> str:

Console

Click Run to execute sample tests.