I recently encountered a question in a coding round of a company the question is as follows "You are given a string return the length of longest even palindromic substring"
Example : Str = "aabbbcd" answer is 2 , str = "abccbk" answer is 4.
The constraints were Len(S) < 106
They expected O(n) or O(nlogn) Solution but the solution I came up with was the naive method which is O(n2). (This idea is intuitive)
Can we do any better I'm not sure if we can.