HTML5 Mobile
Written by: Max Firtman
Featured Refcardz: Top Refcardz:
  1. Git
  2. Data Mining
  3. Spring Data
  4. Subversion
  5. HTML5 Mobile
  1. HTML5 Mobile
  2. HTML5
  3. Subversion
  4. Git
  5. Java

Link Details

Link 939081 thumbnail
User 225256 avatar

By mswatcher
via davidoncode.blogspot.com.au
Published: Mar 14 2013 / 10:00

This is a non optimal (see below for optimal solution), but much easier to understand solution. It uses the following algorithm. At a position of the string, it compares the character at the left and right to see if they're the same. If they are, it looks one character further out on each side and compares them. And so on until it reaches an end of the string or finds the two characters are different. 
  • 2
  • 0
  • 200
  • 216

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (2)



Voters Against This Link (0)