1718. Construct the Lexicographically Largest Valid Sequence
Description
**Input:** n = 3
**Output:** [3,1,2,3,2]
**Explanation:** [2,3,2,1,3] is also a valid sequence, but [3,1,2,3,2] is the lexicographically largest valid sequence.**Input:** n = 5
**Output:** [5,3,1,4,3,5,2,4,2]ac
Last updated