Tap here to switch tabs
Problem
Submissions

Problem: Unique Length-3 Palindromic Subsequences

med
30 min
Try to solve the Unique Length-3 Palindromic Subsequences problem.

Statement

Given a string s, return the count of unique palindromic subsequences of length 33 that exist within s.

Even if a particular subsequence can be formed in multiple ways, it is counted only once.

A palindrome is a string that reads the same forwards and backwards. A subsequence is derived from the original string by deleting zero or more characters without altering the relative order of the remaining characters.

Constraints:

  • 3≤3 \leq s.length ≤105\leq 10^5

  • s consists of only lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Unique Length-3 Palindromic Subsequences

med
30 min
Try to solve the Unique Length-3 Palindromic Subsequences problem.

Statement

Given a string s, return the count of unique palindromic subsequences of length 33 that exist within s.

Even if a particular subsequence can be formed in multiple ways, it is counted only once.

A palindrome is a string that reads the same forwards and backwards. A subsequence is derived from the original string by deleting zero or more characters without altering the relative order of the remaining characters.

Constraints:

  • 3≤3 \leq s.length ≤105\leq 10^5

  • s consists of only lowercase English letters.