Skip to content

Files

Latest commit

author
Shoaib Rayeen
Dec 16, 2018
56399d0 · Dec 16, 2018

History

History
7 lines (6 loc) · 356 Bytes

File metadata and controls

7 lines (6 loc) · 356 Bytes

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.