I would like to add this question as well, as it builds strong conceptual understanding and is challenging, making it valuable for improving problem-solving skills.
📝 Problem Statement
Given a string s, find the length of the longest subsequence of s that is also a palindrome.
A subsequence is a sequence derived from another sequence by deleting some or no characters, without changing the order of the remaining characters.
Example::
Example 1:
Input: s = "bbbab"
Output: 4
Explanation: The longest palindromic subsequence is "bbbb".
I would like to add this question as well, as it builds strong conceptual understanding and is challenging, making it valuable for improving problem-solving skills.
📝 Problem Statement
Given a string s, find the length of the longest subsequence of s that is also a palindrome.
A subsequence is a sequence derived from another sequence by deleting some or no characters, without changing the order of the remaining characters.
Example::
Example 1:
Input: s = "bbbab"
Output: 4
Explanation: The longest palindromic subsequence is "bbbb".