This is a solution of one google interview question. See README for more descriptions of the question.