Company: Media_net_.
Difficulty: medium
Problem Description Given a string of lowercase alphabets A of size N and an integer array B of size Q. Return an array of integers C of size Q where C[i] is the number of odd-length palindromes centered at index B[i]. NOTE: The indices in array B are 1-based. Examples Example 1 Input A = "aaa" B = [1, 2, 3] Output C = [1, 2, 1] Explanation For the query B[i] = 1, the center is the first 'a'. The odd-length palindromes are {"a"}. Count = 1. For the query B[i] = 2, the center is the second 'a'. The odd-length palindromes are {"a", "aaa"}. Count = 2. For the query B[i] = 3, the center is the third 'a'. The odd-length palindromes are {"a"}. Count = 1. Example 2 Input A = "aababaa" B = [1, 2, 3, 4, 5, 6, 7] Output C = [1, 1, 2, 4, 2, 1, 1] Constraints 1 <= N <= 10^6 1 <= B[i] <= N String A consists of lowercase alphabets only.