This is the solution for the problem provided by Zappos.com for their Software Engineer internship position.