Here is the interview question prompt, presented for reference.
We're given a string that's a mixture of several alphabetical characters.
const str = "algototheehtotdaily";
Could you write a method to find the longest substring that is considered a palindrome? In the above example, it would be "totheehtot"
.
Where there are multiple longest palindromic substrings of the same length, for example in "abracadabra"
("aca"
and "ada"
), return the first to appear.
O(n^2)
O(n^2)
You can see the full challenge with visuals at this link.
Challenges • Asked almost 7 years ago by Jake from AlgoDaily
This is the main discussion thread generated for Longest Palindromic Substring.