Construct the Lexicographically Largest Valid Sequence

Given an integer n, construct a sequence of length 2*n where:

  • The first n numbers are a permutation of 1 to n
  • The remaining n numbers are a permutation of 1 to n
  • For each i from 1 to n, the number i appears at positions i and somewhere after

Return the lexicographically largest such sequence.

Examples
Input: 1
Output: [1]
Hints

Construct the Lexicographically Largest Valid Sequence

Given an integer n, construct a sequence of length 2*n where: