def count_distinct_palindromes(s: str) -> int:
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?
s = "mokkori"
There are 7 distinct palindromes.
(They are m, o, k, r, i, kk and okko; the report gives only the count.)
Reported six times in Citadel online assessments between January 2025 and mid-2026, for a new-grad role, an EQR role and recruiter-sourced candidates, usually as the first of two or three coding problems (one assessment was 90 minutes for three). One report posts the prompt word for word with the "mokkori" example; three call it LeetCode 647 exactly; one warns to return unique substrings at the end.
Candidates describe it as not hard: one solved all three problems of the assessment in half an hour. The other problems in the same assessments included token expiry and reset, a longest-path-in-a-tree problem, friend recommendation by common friends, and a prefix/suffix substring score.
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?
s = "mokkori"
There are 7 distinct palindromes.
(They are m, o, k, r, i, kk and okko; the report gives only the count.)
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
Send them this page. It is free to read, no account needed.
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.