left and right, to store the maximum palindrome lengths ending before and starting after each index, respectively.left array by iterating from left to right, updating the maximum length palindrome ending at each index.right array by iterating from right to left.left[i - 1] and right[i] for each index i, and keep track of the maximum product found.