Pregunta de entrevista de Google

How would you optimize a function that finds the longest palindrome in a string?

Respuesta de la entrevista

Anónimo

16 feb 2025

I’d use dynamic programming to store substrings, reducing redundant checks. Alternatively, Manacher’s algorithm achieves linear time complexity, significantly improving efficiency over a brute-force approach.