1

Possible Duplicate:
Write a function that returns the longest palindrome in a given string

For example, the given string is "google", then the longest symmetrical string is "goog",therefore the answer should be 4. Any fast algorithm to solve it?

Community
  • 1
  • 1
Carl
  • 135
  • 8

1 Answers1

2

Longest (common) palindromic string search is similar to longest sub-sequence problem.

Try this n this to learn about it in detail.

loxxy
  • 12,990
  • 2
  • 25
  • 56