Doublindromes
Time limit3sMemory limit512 MB
Count distinct substrings of s that are palindromes and split into two non-empty palindromes, with length at least k.
- Level
Hard9 of 10
- Topics
- String, String matching, Hash map, Dynamic programming
- Solved
- No attempts yet
Problem
A string is a doublindrome if it is a palindrome and it can be represented as the concatenation of two non-empty palindromes and .
Given a string consisting of lowercase English letters, find the number of distinct substrings of that are doublindromes of length or more. Two substrings are considered distinct if they differ as strings.
Input
The first line contains one integer (). The second line contains the string consisting of lowercase English letters ().
Output
Print one integer: the answer to the problem.