The task is to write a function which would return the nth lexicographic permutation of a sequence of digits {1..9}. To make it harder function should execute in O(1).

Follow the link in the title, to see the solution.

The task is to write a function which would return the nth lexicographic permutation of a sequence of digits {1..9}. To make it harder function should execute in O(1).

Follow the link in the title, to see the solution.

Answers and Comments