Блог пользователя xennygrimmato

Автор xennygrimmato, 12 лет назад, По-английски

Given two strings, what is the best method to find the longest common palindromic substring?

This problem was asked in a local programming competition in my city, constraints were not specified.

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

»
12 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

Manacher's algorithm. Also you can use hashes + binary search or suffix structures.

»
12 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

We can do it in O(N*logN), you can find it here