Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1930. Unique Length-3 Palindromic Subsequences
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.