Count distinct palindromes
Your task
Given a lowercase string s, count the number of DISTINCT non-empty palindromic substrings (distinct by string content, not by position). For 'aaa' the answer is 2 ('a' and 'aa' and 'aaa' are 3 distinct). For 'abba' the distinct palindromes are 'a','b','bb','abba' = 4. Return that count. Length up to ~2000.
Examples
count_distinct_palindromes(s: str) -> intExample 1
Input
count_distinct_palindromes("abba")Output
4