Palindromic Substrings (LC 647) variant: print all palindromic substrings of length >= 3
Asked in the online skills assessment stage. Implement a function that returns every palindromic substring in a string s with length at least 3. Return the substrings in the order they are discovered by expanding around each center from left to right. Do not include duplicates, even if the same substring appears at multiple positions.
Function signature: def palindromic_substrings(s):
Input: a single string s
Output: a list of strings containing the unique palindromic substrings of length >= 3.
def palindromic_substrings(s):