Tap here to switch tabs
Problem
Submissions

Problem: Permutation Sequence

med
30 min
Try to solve the Permutation Sequence problem.

Statement

The set containing integers from 11 to n has a total of n!n! unique permutations.

By listing and ordering all of these permutations in lexicographical order, an ordered sequence of permutations is formed.

Given two integers n and k, return the kextthk^{ ext{th}} permutation sequence as a string.

Constraints:

  • 1≤1 \leq n ≤9\leq 9

  • 1≤1 \leq k ≤n!\leq n!

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Permutation Sequence

med
30 min
Try to solve the Permutation Sequence problem.

Statement

The set containing integers from 11 to n has a total of n!n! unique permutations.

By listing and ordering all of these permutations in lexicographical order, an ordered sequence of permutations is formed.

Given two integers n and k, return the kextthk^{ ext{th}} permutation sequence as a string.

Constraints:

  • 1≤1 \leq n ≤9\leq 9

  • 1≤1 \leq k ≤n!\leq n!