Given a string str of small alphabetic characters other than this we will be given substring of this string in form of index tuples. We need to find out the count of the palindromic substrings in given substring range.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains an integer N denoting the size of the string.
The second line of each test case contains the string and the third line contains integer q1 and q2 denoting the substring range.
Output the answer to each test case in a new line.
1<= N <=1000
1<= q1, q2 <=1000
For Range1, substring is "aba" |
Count of palindromic substring in "aba" is four : "a", "b", "aba", "a"
For Range2, substring is "aa"
Count of palindromic substring in "aa" is three : "a", "a", "aa"
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.