(similarEnds)
An array has similar N-ends if the front and back N numbers are either
in the reversed order.
Return the largest N value for which an array has the same N-ends.
Examples:
similarEnds([20,30,40]) => -1.similarEnds([20,30,4,5,30,20]) => 2.similarEnds([20,30,40,50,50,40,30,20]) => 8. The repeating segments overlap.similarEnds([10,20,30,20,10]) => 5.