Tap here to switch tabs
Problem
Submissions

Problem: Longest Palindromic Subsequence

med
30 min
Try to solve the Longest Palindromic Subsequence problem.

Statement

Given a string s, return the length of the longest subsequence of s that is a palindrome.

A subsequence is formed by deleting zero or more characters from s without changing the relative order of the remaining characters.

Constraints:

  • 1≤1 \leq s.length ≤1000\leq 1000

  • s consists only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Longest Palindromic Subsequence

med
30 min
Try to solve the Longest Palindromic Subsequence problem.

Statement

Given a string s, return the length of the longest subsequence of s that is a palindrome.

A subsequence is formed by deleting zero or more characters from s without changing the relative order of the remaining characters.

Constraints:

  • 1≤1 \leq s.length ≤1000\leq 1000

  • s consists only of lowercase English letters.