Distinct Palindromic Substrings
Asked at Citadel
Reported by the problem's creator, not verified
Given a string s of lowercase letters, find its distinct palindromic substrings. Implement distinct_palindromes(s), which returns them as a list of strings sorted in lexicographic order.
Examples
Example 1
Input: s =
abaabOutput:
["a","aa","aba","b","baab"]Explanation: Palindromic substrings of
abaabarea,b,aa,abaandbaab.aoccurs three times andbtwice, but each distinct value appears once, in sorted order.
Import your own questions
Paste a question you were asked and get a full problem: statement, tests and a checked solution.