Skip to content

Latest commit

 

History

History

Longest Palindromic Subsequence

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Given a sequence, find the length of the longest palindromic subsequence in it.

As another example, if the given sequence is “BBABCBCAB”, then the output should be 7 as
“BABCBAB” is the longest palindromic subseuqnce in it. “BBBBB” and “BBCBB” are also 
palindromic subsequences of the given sequence, but not the longest ones.