Given a linked list of integers, find the length of the longest contiguous sublist whose values read the same forwards and backwards. Return that length. The list is given as an array.
Input: An array of node values.
Output: Integer — length of the longest palindromic sublist.
Input: [1,2,3,2,1,4]
Output: 5
Explanation: [1,2,3,2,1] is a palindrome of length 5.Input: [1,1,1]
Output: 3
Explanation: All equal.Input: [1,2,3]
Output: 1
Explanation: No longer palindrome than a single node.0<=n<=20000<=value<=10^9