Understanding the longest palindromic subsequence problem


When working with strings, we often care not just about contiguous segments but about characters that can be selected from anywhere within the string while preserving their relative order. One such challenge is to determine the longest sequence of characters that reads the same forward and backwards, without requiring those characters to be adjacent.

This is known as the longest palindromic subsequence problem, where the objective is to find the length of the longest subsequence of the input string that reads the same forward and backward.

Loading Image

Find the length of the longest palindromic subsequence in a string.

Liking the course? Check our discounted plans to continue learning.