Candidate solution for topcoder: 10514