Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 489 Bytes

File metadata and controls

25 lines (17 loc) · 489 Bytes

223.Longest Palindromic Subsequence

Description

Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000.

Example1

Input: "bbbab"
Output: 4
One possible longest palindromic subsequence is "bbbb".

Example2

Input: "cbbd"
Output: 2
One possible longest palindromic subsequence is "bb".

From

LeetCode