An array nums of length n is considered beautiful if it is a permutation of the integers from n, and for every pair of indices i and j with i j n, there does not exist any index k with i k j such that:
nums[k] nums[i] nums[j]
Given an integer n, return any beautiful array nums of length n. It is guaranteed that at least one valid answer exists for the given n.
Constraints:
n
An array nums of length n is considered beautiful if it is a permutation of the integers from n, and for every pair of indices i and j with i j n, there does not exist any index k with i k j such that:
nums[k] nums[i] nums[j]
Given an integer n, return any beautiful array nums of length n. It is guaranteed that at least one valid answer exists for the given n.
Constraints:
n