How to check if array is Palindrome ?

[Question ] Check weather array is palindrome Example : [1,2,2,1] ===> It’s palindrome Solution#: Here we are checking first & last element equality & increase till mid of array