Pergunta de entrevista da empresa Google

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

Resposta da entrevista

Sigiloso

16 de fev. de 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.