Havannah = Hannah

Computer Science Level 5

Given a sequence of characters, you are asked to find the longest palindrome within it. There is a catch: the palindrome can be built by jumping over certain letters as long as it is in order. For example for the string havannah, the hiden palindrome would be:

\[\color{red} {\text{ha}} \text{va} \color{red} {\text{nnah}} = \text{hannah} \]

A string might have more than one such hidden palindrome. For example ,alfalfa has four hidden palindromes of length \(5\): 'alala', 'afafa', 'alfla','aflfa'

Find the length of the longest hidden palindrome for the following string.


Problem Loading...

Note Loading...

Set Loading...