Problem Statement:
504C - Misha and Palindrome Degree
Solution:
The official editorial to this problem is pretty much clearly explained. This post is mostly a self-note.
In a palindrome, there must be at most only one element with an odd number of occurrences, i.e. the rest of the elements must occur in even number of time. Next, given an array \(a_i\), we can first match all \(a_i\) with \(a_{N-i-1}\) from leftmost element, and stop when they differ.