Tap here to switch tabs
Problem
Submissions

Problem: Count Palindromic Subsequences

med
30 min
Try to solve the Count Palindromic Subsequences problem.

Statement

Given a string s made up only of digit characters, count how many subsequences of s form a palindrome of length 55.

Return the total number of such palindromic subsequences.

Note:

  • A string is palindromic if it reads the same forward and backward.

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

  • A subsequence is defined by the indices chosen from s, so identical resulting strings formed from different index selections are counted multiple times.

Constraints:

  • 11 \leq s.length 104\leq 10^4

  • s consists of digits.

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths
Tap here to switch tabs
Problem
Submissions

Problem: Count Palindromic Subsequences

med
30 min
Try to solve the Count Palindromic Subsequences problem.

Statement

Given a string s made up only of digit characters, count how many subsequences of s form a palindrome of length 55.

Return the total number of such palindromic subsequences.

Note:

  • A string is palindromic if it reads the same forward and backward.

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

  • A subsequence is defined by the indices chosen from s, so identical resulting strings formed from different index selections are counted multiple times.

Constraints:

  • 11 \leq s.length 104\leq 10^4

  • s consists of digits.

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths