Check if an array has some palindromic subsequence of length at least 3
Given is an array Arr of integers. The task is to determine if the array has any subsequence of at least length 3 that is a palindrome. Examples: Input: Arr[] = [1, 2, 1] Output: YESExplanation: Here 1 2 1 is a palindrome. Input: Arr[] = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]Output: NOExplanation: Here no s