Longest Palindromic Subsequence
Medium

Problem Statement

Find the length of the longest subsequence of a given string that is also a palindrome.

Examples

1Example 1
Input:
{ "s": "bbbab" }
Output:
4
2Example 2
Input:
{ "s": "cbbd" }
Output:
2
3Example 3
Input:
{ "s": "agbcba" }
Output:
5
Loading...

Sign in to Run Code and Submit