Friday, April 18, 2014

Longest Palindrome in a String

Let's start with a classic!

Given a string, write a function that returns the longest palindrome in that string.  For example:

Input: "A racecar goes fast.  Toyota.  Honda.  They're both good."
Output: "racecar"

Some things to consider are:

  • What happens if the palindrome has an even number of characters?
  • What kind of time complexity can we get?

A solution will be posted in a few days!


No comments:

Post a Comment