TopCoder challenge.