EP-Palindromes

You will be given an array of integers $A$. You have to count the number of $\textbf{subarrays}$ (a non-empty sequence of consecutive elements of an array) of $A$ that are EP-Palindrome.


This is a companion discussion topic for the original entry at https://toph.co/p/ep-palindromes