Find the longest prefix of a string that is a palindrome.
O(n2) is easy, but you need come up with something that's O(n).
Hint: KMP
Subscribe to:
Post Comments (Atom)
Just something whacky to get you thinking. At least it got me pulling apart my hair, and now, I'm half bald.
No comments:
Post a Comment