Tap here to switch tabs
Problem
Submissions

Problem: Permutation Sequence

Permutation Sequence orders all unique permutations of the integers from one through n lexicographically. Given n and a valid rank k, return the permutation at that position as a string.

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 kthk^{ {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

Permutation Sequence orders all unique permutations of the integers from one through n lexicographically. Given n and a valid rank k, return the permutation at that position as a string.

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 kthk^{ {th}} permutation sequence as a string.

Constraints:

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

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