Given an array arr, count how many times the ith element from the front equals the ith element from the back. If the array length is odd, do not count the center element.