Marks :10
: 8 | : 1
Given a string $$$S$$$ (consisting of only lower characters) and $$$Q$$$ queries.
In each query, you will given an integer $$$i$$$ and your task is to find the length of the longest $$$(length>1)$$$ odd palindromic substring whose middle index is $$$i$$$ .
$$$\bf Note:$$$
1. Assume $$$1$$$-based indexing
2. Longest odd palindrome: A palindrome substring whose length is odd.
The first line contains the string $$$S$$$ $$$(1 \le |S| \le 10^5)$$$.
The second line contains an integer $$$Q$$$ $$$(1 \le Q \le 10^5)$$$ denoting the number of queries.
The third line contains the $$$Q$$$ queries, $$$Q_1,Q_2...Q_n$$$ where $$$(1 \le Q_i \le |S|)$$$.
Return an array of integers where $$$i^{th}$$$ integer denotes the answer of $$$i^{th}$$$ query.
aaaaa 2 2 3
3 5
abcd 1 2
0
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.