you give string word1 word2 you want construct string follow mannerchoose nonempty subsequence subsequence1 word1Choose nonempty subsequence subsequence2 word2concatenate subsequence subsequence1 subsequence2 stringreturn length long palindrome construct describe manner if palindrome construct return 0A subsequence stre s string delete possibly character s change order remain charactersA palindrome string read forward backward Example 1input word1 cacb word2 cbbaoutput 5explanation Choose ab word1 cba word2 abcba palindromeExample 2Input word1 ab word2 abOutput 3explanation Choose ab word1 word2 aba palindromeExample 3input word1 aa word2 bbOutput 0explanation you construct palindrome describe method return 0 constraints1 word1length word2length 1000word1 word2 consist lowercase english letter