AO
Back

Count (Distinct) Palindromic Substrings (LC 647 variant)

OAAsync OALast reported June 2026Medium Frequency

Problem Overview

A palindrome is a string that reads the same forwards and backwards, such as 121 or tacocat. A substring is a contiguous sequence of characters within a string.

Given a string s, how many unique substrings of s are palindromes?

Example (as posted)

s = "mokkori"
There are 7 distinct palindromes.

(They are m, o, k, r, i, kk and okko; the report gives only the count.)

Notes from the reports

  • Reported in Citadel online assessments from January 2025 to mid-2026, usually as the first of two or three coding problems.
  • Confirm before coding: the report that posts this prompt asks for unique palindromes, and another warns to return unique substrings, but three reports call it LeetCode 647 exactly, which counts every occurrence ("mokkori" would then give 9).
  • No input sizes, character set or function signature were reported.

What Reports Emphasize

Observed variants: Distinct palindromic substrings: the prompt posted word for word ("mokkori" gives 7), and one report that says to return unique substrings | Described in three reports as LeetCode 647 exactly, which counts every occurrence

Practice

Write your own against 8 test cases, or read the worked solution — approach, complexity, and code that runs.

Prepping for Citadel with friends?

Send them this page. It is free to read, no account needed.

More Citadel Questions

Free preview

Every question in the Citadel catalog gets this depth

What you just read — canonical solution, follow-up arc, what passing candidates actually did — exists for all 62 Citadel questions, refreshed monthly from new candidate reports.

$59/mo — or $50/mo with the 3-month pass · cancel anytime
Citadel · OA · Reported 5× across candidate reports
Is this helpful?