You are given two strings, word1 and word2.
You want to construct a string by concatenating a non empty subsequence of word1 and a non empty subsequence of word2.
Return the maximum length of a palindrome that can be constructed in this manner. If no palindrome can be formed, return
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:
word1.length, word2.length
word1 and word2 consist of lowercase English letters.
You are given two strings, word1 and word2.
You want to construct a string by concatenating a non empty subsequence of word1 and a non empty subsequence of word2.
Return the maximum length of a palindrome that can be constructed in this manner. If no palindrome can be formed, return
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:
word1.length, word2.length
word1 and word2 consist of lowercase English letters.