Given a string s, return the length of the longest good palindromic subsequence in s.
A string is considered a good palindromic subsequence if:
It is a subsequence of s.
It is a palindrome.
Its length is an even number.
No two consecutive characters are identical, except for the two middle characters (that is, for a string of length
Note: A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.
Constraints:
s.length
s consists of lowercase English letters.
Given a string s, return the length of the longest good palindromic subsequence in s.
A string is considered a good palindromic subsequence if:
It is a subsequence of s.
It is a palindrome.
Its length is an even number.
No two consecutive characters are identical, except for the two middle characters (that is, for a string of length
Note: A subsequence is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.
Constraints:
s.length
s consists of lowercase English letters.