First of all, 'b' and 'd' are different, so the longest palindromic substring is of length 1. Then it comes down to the question of which version of the substring to choose. If it returns "a", it means the algorithm choose the first longest substring.
@solosodium Thanks for the reply. I understand what you said. But do you agree that this is an wrong input? It was described in the question that there only exist one unique right answer. I'm a picky person, never mind~ Thanks anyway!
I have the same query. in "abcda", 'b' and 'd' are as valid as 'a' and the question doesn't ask for the first longest substring. Anyone knows how to ask the Admin about this?
I have the same problem. got this as wrong input. Maybe the question is wrong...
@1337c0d3r could you please explain in what scenes the issue was fixed. The test case still expects "a" for the string "abcda" in my opinion there is no palindromic sub-string at all in this input.
@Cepera Previously, the judge will only accept "a" for the input "abcda". But "b", "c", or "d" are also valid answers. So the judge should accept any of them as correct answer. Your code returns
"" for this input, so it is judged as Wrong Answer.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.