Number of Palindrome
You are given a string S. We want to know how many distinct substrings of S are palindromes.
InputEach test case consists of only one string S, whose length is less than 100000 and only contains lowercase letters.
OutputOutput the number of distinct substrings of S which are palindromes.
Sample Input 1:
aaaaSample Output 1:
4Sample Input 2:
ababSample Output 2:
4Sample Input 3:
abcdSample Output 3:
4Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.