Skip to content

Latest commit

 

History

History

permutation_sequence

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

60. Permutation Sequence

Description

The set [1,2,3,…,_n_] contains a total of n! unique permutations.

By listing and labeling all of the permutations in order,

We get the following sequence (ie, for n = 3):

  1. “123“
  2. “132“
  3. “213“
  4. “231“
  5. “312“
  6. “321“

Given n and k, return the _k_th permutation sequence.

Note: Given n will be between 1 and 9 inclusive.