Trying to solve the problem posted by Quora as a programming challenge. http://www.quora.com/about/challenges