Palindrome Array Leetcode Problems Python