Palindrome Array Leetcode Question