This is the easy version of the problem. The only difference between the two versions is the constraint on $$$n$$$.
You have an array of length $$$n$$$, We declare function $$$f(x)$$$ for a non-empty subsequence of the array as the minimum number of moves needed to change the subsequence's elements to make the subsequence $$$palindrome$$$. The move is defined as follows.
Now your task is to find sum of $$$f(x)$$$ for all non-empty subsequences of the array.
In the first line of input You'll be given number $$$n$$$ which shows the length of the array.
In the second line You'll receive the array.
$$$1 \le n \le 10^3$$$.
$$$1 \le a_i \le n$$$.
Print an integer representing the sum of $$$f(x)$$$ for all non-empty subsequences, as the answer may be large, Print it modulo $$$998244353$$$.
5 4 2 4 3 5
30
10 2 2 1 1 3 2 3 4 1 3
1969
5 2 5 3 1 4
32