Score : $400$ points
You are given a sequence of $N$ positive integers: $A=(A_1,A_2, \dots A_N)$. You can do the operation below zero or more times. At least how many operations are needed to make $A$ a palindrome?
Here, we say $A$ is a palindrome if and only if $A_i=A_{N+1-i}$ holds for every $i$ ($1 \le i \le N$).
Input is given from Standard Input in the following format:
$N$ $A_1$ $A_2$ $\dots$ $A_N$
Print the answer as an integer.
8 1 5 3 2 5 2 3 1
2
In this way, we can make $A$ a palindrome in two operations, which is the minimum needed.
7 1 2 3 4 1 2 3
1
1 200000
0
$A$ may already be a palindrome in the beginning.