Question bank › Two Pointers
Dsa Two Pointers Hard

Distinct Palindromic Subsequences

Given a string s, determine the number of distinct palindromic subsequences that can be formed from it. Implement a function that reads from standard input and outputs the count of distinct palindromic subsequences. Example: Input: abba Output: 4 Input Description: A single string s (1 ≤ |s| ≤ 100).

Key concepts

two_pointerspalindromessubsequences

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.