A solution to someone's interview question.