Facebook Pixel

Longest Palindromic Subsequence

Problem Statement

Given a string s, find the length of the longest palindromic subsequence.

A subsequence is derived by deleting some (or no) characters without changing the relative order. A palindrome reads the same forwards and backwards.

s = "bbbab"

Longest palindromic subsequence: "bbbb" (skip the 'a')
Length = 4
Invest in Yourself
Your new job is waiting. 83% of people that complete the program get a job offer. Unlock unlimited access to all content and features.
Go Pro