Palindrome and Queries

You’ll be given an array A of N strings containing lowercase english letters only and Q queries. In each query, you have to find the length of the longest palindromic substring which appears in at least L strings and at most R strings. If there is no such palindromic substring, print 0.


This is a companion discussion topic for the original entry at https://toph.co/p/palindrome-and-queries