title: How to find the longest palindrome in a given string?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1115001/write-a-function-that-returns-the-longest-palindrome-in-a-given-string">Write a function that returns the longest palindrome in a given string</a>  </p>
  </blockquote>
  
  
  
  <p>I know how to do this in O(n^2). But it seems like there exist a better solution.</p>
  
  <p>I've found <a href="https://stackoverflow.com/questions/1115001/write-a-function-that-returns-the-longest-palindrome-in-a-given-string-e-g-ccdd">this</a>, and there is a link to O(n) answer, but it's written in Haskell and not clear for me.</p>
  
  <p>It would be great to get an answer in c# or similar.</p>