We’re preparing your current view and syncing the latest data.
An array A is beautiful if for every i < j, there is no k with i < k < j such that A[k] * 2 = A[i] + A[j]. Given an integer n, return any beautiful array A of size n. The answer is guaranteed to exist.
An integer n representing the size of the array.
An array of integers A of size n that is beautiful.
1 <= n <= 1000
Example 1
Input
4
Output
[2,1,4,3]
Explanation
The output is a beautiful array of size 4. No element in the array is the average of two others.