Available question text
Count the number of distinct length-3 palindromic subsequences in s — i.e., unique strings of the form "a b a" that can be formed as subsequences. The key observation is that each palindrome is determined by a matching outer character and a middle character, so you can count, for each letter that appears at least twice, the distinct characters occurring between its occurrences.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1930. Unique Length-3 Palindromic Subsequences
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source